aboutsummaryrefslogtreecommitdiff
path: root/build2/test/common.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-01-27 15:25:26 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-02-13 12:42:41 +0200
commitf93038fbee1631b95922b0742e0fd00fa8dae02e (patch)
tree6fe67cbde528ee8ded490085b9a8d5adc0ce5aca /build2/test/common.cxx
parent267d34d2800d9cc3ed2865cbecf8d32f8f1ab6ec (diff)
Add notion of phase, enforce
Diffstat (limited to 'build2/test/common.cxx')
-rw-r--r--build2/test/common.cxx22
1 files changed, 14 insertions, 8 deletions
diff --git a/build2/test/common.cxx b/build2/test/common.cxx
index 66be9d8..1b4c194 100644
--- a/build2/test/common.cxx
+++ b/build2/test/common.cxx
@@ -136,14 +136,19 @@ namespace build2
r = d.sub (n->dir);
else
// First quickly and cheaply weed out names that cannot possibly
- // match. Only then search for a target as if it was a prerequisite,
- // which can be expensive.
+ // match. Only then search for a target (as if it was a
+ // prerequisite), which can be expensive.
+ //
+ // We cannot specify an src target in config.test since we used
+ // the pair separator for ids. As a result, we search for both
+ // out and src targets.
//
r =
- t.name == n->value && // Name matches.
- tt.name == n->type && // Target type matches.
- d == n->dir && // Directory matches.
- search (*n, *root_) == t;
+ t.name == n->value && // Name matches.
+ tt.name == n->type && // Target type matches.
+ d == n->dir && // Directory matches.
+ (search_existing (*n, *root_) == &t ||
+ search_existing (*n, *root_, d) == &t);
if (r)
break;
@@ -189,8 +194,9 @@ namespace build2
r =
t.name == n->value &&
tt.name == n->type &&
- d == n->dir &&
- search (*n, *root_) == t;
+ d == n->dir &&
+ (search_existing (*n, *root_) == &t ||
+ search_existing (*n, *root_, d) == &t);
if (!r)
continue; // Not our target.