diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-04-19 09:24:38 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-04-19 15:25:50 +0200 |
commit | fc18a6dc1fcb02b505f07914e484cebbaf268698 (patch) | |
tree | 2cb9b04c5924dfd46e7d934912b41c3efd894a93 /build2/cli/rule.cxx | |
parent | ae20570f2ad55b2fa8e71cf450457cb9c4b21b1b (diff) |
Redesign src/out scoping
We no longer enter paths from the src tree into scope map. Instead, targets
from the src tree now include their out tree directory (in essence their
"configuration"). This is then used to find a target's scope. See the
comment in class target for details.
The result of this change is that we can now again build multiple
configurations (out trees) for same project at once.
Diffstat (limited to 'build2/cli/rule.cxx')
-rw-r--r-- | build2/cli/rule.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/build2/cli/rule.cxx b/build2/cli/rule.cxx index ece5424..65e940b 100644 --- a/build2/cli/rule.cxx +++ b/build2/cli/rule.cxx @@ -87,15 +87,15 @@ namespace build2 // if (t.h == nullptr) { - t.h = &search<cxx::hxx> (t.dir, t.name, nullptr, nullptr); + t.h = &search<cxx::hxx> (t.dir, t.out, t.name, nullptr, nullptr); t.h->group = &t; - t.c = &search<cxx::cxx> (t.dir, t.name, nullptr, nullptr); + t.c = &search<cxx::cxx> (t.dir, t.out, t.name, nullptr, nullptr); t.c->group = &t; if (!find_option ("--suppress-inline", t, "cli.options")) { - t.i = &search<cxx::ixx> (t.dir, t.name, nullptr, nullptr); + t.i = &search<cxx::ixx> (t.dir, t.out, t.name, nullptr, nullptr); t.i->group = &t; } } @@ -116,7 +116,7 @@ namespace build2 // Then check if there is a corresponding cli.cxx{} group. // - cli_cxx* g (targets.find<cli_cxx> (t.dir, t.name)); + cli_cxx* g (targets.find<cli_cxx> (t.dir, t.out, t.name)); // 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 @@ -133,7 +133,7 @@ namespace build2 if (match_stem (t.name, p.name ())) { if (g == nullptr) - g = &targets.insert<cli_cxx> (t.dir, t.name, trace); + g = &targets.insert<cli_cxx> (t.dir, t.out, t.name, trace); g->prerequisites.emplace_back (p.as_prerequisite (trace)); } |