aboutsummaryrefslogtreecommitdiff
path: root/build2/target.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-04-29 08:58:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-04-29 08:58:07 +0200
commitf912a6c1090875b16792da4848c47759a38f1ef4 (patch)
treef1541ca7fcbeec048f50b956df3024155ee058b7 /build2/target.cxx
parentc0ff56e222b25561c39600a2787d8099d1098a10 (diff)
Fix bug in default target logic
Diffstat (limited to 'build2/target.cxx')
-rw-r--r--build2/target.cxx46
1 files changed, 24 insertions, 22 deletions
diff --git a/build2/target.cxx b/build2/target.cxx
index 1922570..f7500f7 100644
--- a/build2/target.cxx
+++ b/build2/target.cxx
@@ -819,31 +819,33 @@ namespace build2
t = search_existing_target (pk);
if (t != nullptr && !t->implied)
- return t;
-
- // Ok, no luck, switch the scope.
- //
- pair<scope&, scope*> sp (
- switch_scope (*s.rw ().root_scope (), out_base));
-
- if (sp.second != nullptr) // Ignore scopes out of any project.
+ retest = true;
+ else
{
- scope& base (sp.first);
- scope& root (*sp.second);
+ // Ok, no luck, switch the scope.
+ //
+ pair<scope&, scope*> sp (
+ switch_scope (*s.rw ().root_scope (), out_base));
- const dir_path& src_base (base.src_path ());
-
- path bf (src_base / "buildfile");
-
- if (exists (bf))
- {
- l5 ([&]{trace << "loading buildfile " << bf << " for " << pk;});
- retest = source_once (root, base, bf, root);
- }
- else if (exists (src_base))
+ if (sp.second != nullptr) // Ignore scopes out of any project.
{
- t = dir::search_implied (base, pk, trace);
- retest = (t != nullptr);
+ scope& base (sp.first);
+ scope& root (*sp.second);
+
+ const dir_path& src_base (base.src_path ());
+
+ path bf (src_base / "buildfile");
+
+ if (exists (bf))
+ {
+ l5 ([&]{trace << "loading buildfile " << bf << " for " << pk;});
+ retest = source_once (root, base, bf, root);
+ }
+ else if (exists (src_base))
+ {
+ t = dir::search_implied (base, pk, trace);
+ retest = (t != nullptr);
+ }
}
}
}