From a4796d5b851dac4a546f89c282f65e320076eb10 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 27 Aug 2016 09:53:30 +0200 Subject: Clean up library export, make c and cxx modules project root only So now c and cxx modules can only be loaded in project root scope (normally root.build). Also, the c.std and cxx.std must now be set *before* loading the module to take effect. This means we won't be able to handle old buildfiles anymore but old versions of build2 should be able to handle new *.std placement. --- build2/cc/compile.cxx | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'build2/cc/compile.cxx') diff --git a/build2/cc/compile.cxx b/build2/cc/compile.cxx index fdd4231..20cd392 100644 --- a/build2/cc/compile.cxx +++ b/build2/cc/compile.cxx @@ -82,7 +82,8 @@ namespace build2 append_options (args, l, var); }; - link_.process_libraries (l, l.is_a (), true, nullptr, opt); + link_.process_libraries ( + sys_lib_dirs, l, l.is_a (), true, nullptr, opt); } void compile:: @@ -102,7 +103,8 @@ namespace build2 hash_options (cs, l, var); }; - link_.process_libraries (l, l.is_a (), true, nullptr, opt); + link_.process_libraries ( + sys_lib_dirs, l, l.is_a (), true, nullptr, opt); } recipe compile:: @@ -172,7 +174,7 @@ namespace build2 // When cleaning, ignore prerequisites that are not in the same or a // subdirectory of our project root. // - optional lib_paths; // Extract lazily. + optional usr_lib_dirs; // Extract lazily. lorder lo; if (a.operation () == update_id) @@ -197,7 +199,7 @@ namespace build2 // if (p.proj () == nullptr || link_.search_library ( - lib_paths, p.prerequisite, lo) == nullptr) + sys_lib_dirs, usr_lib_dirs, p.prerequisite, lo) == nullptr) { match_only (a, p.search ()); } @@ -280,7 +282,7 @@ namespace build2 hash_options (cs, t, x_poptions); hash_options (cs, t, c_coptions); hash_options (cs, t, x_coptions); - hash_std (cs, rs, t); + hash_std (cs); if (ct == otype::s) { @@ -461,7 +463,8 @@ namespace build2 append_prefixes (m, l, var); }; - link_.process_libraries (l, l.is_a (), true, nullptr, opt); + link_.process_libraries ( + sys_lib_dirs, l, l.is_a (), true, nullptr, opt); } auto compile:: @@ -689,9 +692,8 @@ namespace build2 // const process_path* xc (nullptr); cstrings args; - string std; // Storage. - auto init_args = [&t, lo, &src, &rs, &xc, &args, &std, this] () + auto init_args = [&t, lo, &src, &rs, &xc, &args, this] () { xc = &cast (rs[x_path]); args.push_back (xc->recall_string ()); @@ -719,7 +721,7 @@ namespace build2 append_options (args, t, c_coptions); append_options (args, t, x_coptions); - append_std (args, rs, t, std); + append_std (args); if (t.is_a ()) { @@ -1388,9 +1390,9 @@ namespace build2 append_options (args, t, c_coptions); append_options (args, t, x_coptions); - string std, out, out1; // Storage. + string out, out1; // Storage. - append_std (args, rs, t, std); + append_std (args); if (cid == "msvc") { -- cgit v1.1