From f93038fbee1631b95922b0742e0fd00fa8dae02e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 27 Jan 2017 15:25:26 +0200 Subject: Add notion of phase, enforce --- build2/test/common.cxx | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'build2/test/common.cxx') 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. -- cgit v1.1