diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-08-27 09:53:30 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-08-27 09:53:30 +0200 |
commit | a4796d5b851dac4a546f89c282f65e320076eb10 (patch) | |
tree | 584d8fb67dcf333aeb3ae155bb73cf7d230b3ac4 /build2/cc/compile.cxx | |
parent | f0edc0e2b67fa43c4e2410c7d3d8f1841d576749 (diff) |
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.
Diffstat (limited to 'build2/cc/compile.cxx')
-rw-r--r-- | build2/cc/compile.cxx | 24 |
1 files changed, 13 insertions, 11 deletions
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<liba> (), true, nullptr, opt); + link_.process_libraries ( + sys_lib_dirs, l, l.is_a<liba> (), true, nullptr, opt); } void compile:: @@ -102,7 +103,8 @@ namespace build2 hash_options (cs, l, var); }; - link_.process_libraries (l, l.is_a<liba> (), true, nullptr, opt); + link_.process_libraries ( + sys_lib_dirs, l, l.is_a<liba> (), 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<dir_paths> lib_paths; // Extract lazily. + optional<dir_paths> 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<liba> (), true, nullptr, opt); + link_.process_libraries ( + sys_lib_dirs, l, l.is_a<liba> (), 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<process_path> (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<objs> ()) { @@ -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") { |