From 5035f4ef68922ac758b1e4734e67d73c9228010b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 22 Aug 2019 14:38:57 +0200 Subject: Introduce notion of build context All non-const global state is now in class context and we can now have multiple independent builds going on at the same time. --- libbuild2/file.hxx | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'libbuild2/file.hxx') diff --git a/libbuild2/file.hxx b/libbuild2/file.hxx index 48d1b63..aaa0fa0 100644 --- a/libbuild2/file.hxx +++ b/libbuild2/file.hxx @@ -69,11 +69,6 @@ namespace build2 LIBBUILD2_SYMEXPORT pair find_out_root (const dir_path&, optional& altn); - // The old/new src_root paths. See main() (where they are set) for details. - // - LIBBUILD2_SYMEXPORT extern dir_path old_src_root; - LIBBUILD2_SYMEXPORT extern dir_path new_src_root; - // If buildfile is '-', then read from STDIN. // LIBBUILD2_SYMEXPORT void @@ -91,8 +86,8 @@ namespace build2 source_once (scope& root, scope& base, const path&, scope& once); // Create project's root scope. Only set the src_root variable if the passed - // src_root value is not empty. The scope argument is only used as proof of - // lock. + // src_root value is not empty. The scope argument is only used for context + // and as a proof of lock. // LIBBUILD2_SYMEXPORT scope_map::iterator create_root (scope&, const dir_path& out_root, const dir_path& src_root); @@ -140,7 +135,7 @@ namespace build2 // argument semantics. // LIBBUILD2_SYMEXPORT dir_path - bootstrap_fwd (const dir_path& src_root, optional& altn); + bootstrap_fwd (context&, const dir_path& src_root, optional& altn); // Bootstrap the project's root scope, the out part. // @@ -201,7 +196,7 @@ namespace build2 // an indication of whether the variable was found. // LIBBUILD2_SYMEXPORT pair - extract_variable (const path&, const variable&); + extract_variable (context&, const path&, const variable&); // Import has two phases: the first is triggered by the import directive in // the buildfile. It will try to find and load the project. Failed that, it @@ -224,7 +219,7 @@ namespace build2 import (scope& base, name, const location&); const target& - import (const prerequisite_key&); + import (context&, const prerequisite_key&); // As above but only imports as an already existing target. Unlike the above // version, this one can be called during the execute phase. @@ -232,7 +227,7 @@ namespace build2 // Note: similar to search_existing(). // const target* - import_existing (const prerequisite_key&); + import_existing (context&, const prerequisite_key&); } #include -- cgit v1.1