diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-11-30 14:24:16 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-11-30 14:24:16 +0200 |
commit | 1fb88fce9681e88f4140457cfe00a998d9c2588d (patch) | |
tree | 0cab858f57ea317868ccc84b541a57f7356bd24a | |
parent | f69a52486b9b9521ee47843ece1093b0b6ee81ea (diff) |
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.
-rw-r--r-- | build/cli/rule.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
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<cli_cxx> (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<cli_cxx> (t.dir, t.name, trace); + if (g == nullptr) + g = &targets.insert<cli_cxx> (t.dir, t.name, trace); + g->prerequisites.emplace_back (p.as_prerequisite (trace)); } else |