From 1fb88fce9681e88f4140457cfe00a998d9c2588d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 30 Nov 2015 14:24:16 +0200 Subject: Add cli{} prerequisite if cli.cxx{} group doesn't have any This happens when we use the group only for setting cli.options. Not very clean. --- build/cli/rule.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'build/cli') diff --git a/build/cli/rule.cxx b/build/cli/rule.cxx index ef3b1dc..274f193 100644 --- a/build/cli/rule.cxx +++ b/build/cli/rule.cxx @@ -100,10 +100,11 @@ namespace build // cli_cxx* g (targets.find (t.dir, t.name)); - // If not but this target has a cli{} prerequisite, synthesize - // the group. + // If not or if it has no prerequisites (happens when we use it to + // set cli.options) and this target has a cli{} prerequisite, then + // synthesize the group. // - if (g == nullptr) + if (g == nullptr || !g->has_prerequisites ()) { for (prerequisite_member p: group_prerequisite_members (a, t)) { @@ -113,7 +114,9 @@ namespace build // if (t.name == p.name ()) { - g = &targets.insert (t.dir, t.name, trace); + if (g == nullptr) + g = &targets.insert (t.dir, t.name, trace); + g->prerequisites.emplace_back (p.as_prerequisite (trace)); } else -- cgit v1.1