From 91495e646c688eade6b46f21bb40e3da8b8d6f1a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 23 Jan 2017 08:21:53 +0200 Subject: Implement automatic loading of directory buildfiles Now instead of explicitly writing: d = foo/ bar/ ./: $d include $d We can (usually) just write: ./: foo/ bar/ --- build2/file | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'build2/file') 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 + switch_scope (scope& root, const dir_path&); + // Bootstrap the project's root scope, the out part. // void -- cgit v1.1