From 5974cab56148a18628bfb423189e016ade2d40f9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 31 Aug 2015 13:45:57 +0200 Subject: Rework scoping logic Now the src directory is entered into the scope map and points to the same scope as out. This means that targets that are in src, not out (e.g., source files) will "see" rules, variables, etc. This becomes important when we try, for example, to install a source file (say, a header) from src: we need the rule as well as the install.* variables. --- build/cxx/compile.cxx | 4 ++-- build/cxx/link.cxx | 4 ++-- build/cxx/module.cxx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'build/cxx') diff --git a/build/cxx/compile.cxx b/build/cxx/compile.cxx index 514c57a..f9351f2 100644 --- a/build/cxx/compile.cxx +++ b/build/cxx/compile.cxx @@ -88,7 +88,7 @@ namespace build const dir_path* amlg ( a.operation () != clean_id ? nullptr - : &t.strong_scope ().path ()); + : &t.strong_scope ().out_path ()); link::search_paths_cache lib_paths; // Extract lazily. @@ -213,7 +213,7 @@ namespace build return; const dir_path& out_base (t.dir); - const dir_path& out_root (rs->path ()); + const dir_path& out_root (rs->out_path ()); if (auto l = t[var]) { diff --git a/build/cxx/link.cxx b/build/cxx/link.cxx index 3b628b5..2554930 100644 --- a/build/cxx/link.cxx +++ b/build/cxx/link.cxx @@ -492,7 +492,7 @@ namespace build const dir_path* amlg ( a.operation () != clean_id ? nullptr - : &t.strong_scope ().path ()); + : &t.strong_scope ().out_path ()); for (prerequisite_member p: group_prerequisite_members (a, t)) { @@ -573,7 +573,7 @@ namespace build // altogether. So we are going to use the target's project. // root = &t.root_scope (); - out_root = &root->path (); + out_root = &root->out_path (); src_root = &root->src_path (); } diff --git a/build/cxx/module.cxx b/build/cxx/module.cxx index 7171738..6b7da80 100644 --- a/build/cxx/module.cxx +++ b/build/cxx/module.cxx @@ -35,7 +35,7 @@ namespace build bool first) { tracer trace ("cxx::init"); - level4 ([&]{trace << "for " << b.path ();}); + level4 ([&]{trace << "for " << b.out_path ();}); // Initialize the bin module. Only do this if it hasn't already // been loaded so that we don't overwrite user's bin.* settings. -- cgit v1.1