aboutsummaryrefslogtreecommitdiff
path: root/build2/file
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-01-23 08:21:53 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-01-23 08:21:53 +0200
commit91495e646c688eade6b46f21bb40e3da8b8d6f1a (patch)
tree6cfafe23d2ca8a3d2c889961c8df0fffc128c4f7 /build2/file
parent699e3bc87d1cbb3c2b19ddaf5db37909cb49f47b (diff)
Implement automatic loading of directory buildfiles
Now instead of explicitly writing: d = foo/ bar/ ./: $d include $d We can (usually) just write: ./: foo/ bar/
Diffstat (limited to 'build2/file')
-rw-r--r--build2/file14
1 files changed, 11 insertions, 3 deletions
diff --git a/build2/file b/build2/file
index 191e3dc..c8d8f6f 100644
--- a/build2/file
+++ b/build2/file
@@ -59,14 +59,14 @@ namespace build2
source (const path& buildfile, scope& root, scope& base);
// As above but first check if this buildfile has already been sourced for
- // the base scope.
+ // the base scope. Return false if the file has already been sourced.
//
- void
+ bool
source_once (const path& buildfile, scope& root, scope& base);
// As above but checks against the specified scope rather than base.
//
- void
+ bool
source_once (const path& buildfile, scope& root, scope& base, scope& once);
// Create project's root scope. Only set the src_root variable if the
@@ -88,6 +88,14 @@ namespace build2
const dir_path& out_base,
const dir_path& src_base);
+ // Return a scope for the specified directory (first). Note that switching
+ // to this scope might also involve switch to a new root scope (second) if
+ // the new scope is in another project. In the new scope is not in any
+ // project, then NULL is returned in second.
+ //
+ pair<scope&, scope*>
+ switch_scope (scope& root, const dir_path&);
+
// Bootstrap the project's root scope, the out part.
//
void