aboutsummaryrefslogtreecommitdiff
path: root/build2/file.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-09-03 16:45:01 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-09-03 16:45:01 +0200
commit8cbe1701b8461f56ac02b73ede14c886740fb305 (patch)
tree957ec808f1933737204396a821acc9b750ee22f7 /build2/file.cxx
parent53105890d75789c81adbb3d781eff9ebd7110222 (diff)
Cleanup project src/out_root/base discovery logic
Specifically, we no longer support specifying the out_base explicitly and assuming work is src_base.
Diffstat (limited to 'build2/file.cxx')
-rw-r--r--build2/file.cxx23
1 files changed, 9 insertions, 14 deletions
diff --git a/build2/file.cxx b/build2/file.cxx
index 031790f..89120d3 100644
--- a/build2/file.cxx
+++ b/build2/file.cxx
@@ -41,9 +41,9 @@ namespace build2
bool
is_src_root (const dir_path& d)
{
- // @@ Can we have root without bootstrap? I don't think so.
+ // We can't have root without bootstrap.
//
- return exists (d / bootstrap_file) || exists (d / root_file);
+ return exists (d / bootstrap_file);
}
bool
@@ -64,22 +64,17 @@ namespace build2
return dir_path ();
}
- dir_path
- find_out_root (const dir_path& b, bool* src)
+ pair<dir_path, bool>
+ find_out_root (const dir_path& b)
{
for (dir_path d (b); !d.root () && d != home; d = d.directory ())
{
- bool s (false);
- if ((s = is_src_root (d)) || is_out_root (d)) // Order is important!
- {
- if (src != nullptr)
- *src = s;
-
- return d;
- }
+ bool s;
+ if ((s = is_src_root (d)) || is_out_root (d))
+ return make_pair (move (d), s);
}
- return dir_path ();
+ return make_pair (dir_path (), false);
}
static void
@@ -581,7 +576,7 @@ namespace build2
// outer directories is a project's out_root. If so, then
// that's our amalgamation.
//
- const dir_path& ad (find_out_root (out_root.directory ()));
+ const dir_path& ad (find_out_root (out_root.directory ()).first);
if (!ad.empty ())
{