aboutsummaryrefslogtreecommitdiff
path: root/build2/cc/link
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-08-27 09:53:30 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-08-27 09:53:30 +0200
commita4796d5b851dac4a546f89c282f65e320076eb10 (patch)
tree584d8fb67dcf333aeb3ae155bb73cf7d230b3ac4 /build2/cc/link
parentf0edc0e2b67fa43c4e2410c7d3d8f1841d576749 (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/link')
-rw-r--r--build2/cc/link34
1 files changed, 14 insertions, 20 deletions
diff --git a/build2/cc/link b/build2/cc/link
index 474c299..09678c2 100644
--- a/build2/cc/link
+++ b/build2/cc/link
@@ -40,7 +40,8 @@ namespace build2
friend class compile;
void
- process_libraries (file&,
+ process_libraries (const dir_paths&,
+ file&,
bool,
bool,
const function<void (const path&)>&,
@@ -55,21 +56,14 @@ namespace build2
hash_libraries (sha256&, file&, bool) const;
file&
- resolve_library (name, scope&, lorder, optional<dir_paths>&) const;
-
- // Extract system library search paths from GCC or compatible (Clang,
- // Intel) using the -print-search-dirs option.
- //
- void
- gcc_library_search_paths (scope&, dir_paths&) const;
-
- // Extract system library search paths from VC (msvc.cxx).
- //
- void
- msvc_library_search_paths (scope&, dir_paths&) const;
+ resolve_library (name,
+ scope&,
+ lorder,
+ const dir_paths&,
+ optional<dir_paths>&) const;
dir_paths
- extract_library_paths (scope&) const;
+ extract_library_dirs (scope&) const;
bool
pkgconfig_extract (scope&,
@@ -77,7 +71,7 @@ namespace build2
const string*,
const string&,
const dir_path&,
- optional<dir_paths>&,
+ const dir_paths&,
lorder) const;
// Alternative search logic for VC (msvc.cxx).
@@ -93,20 +87,20 @@ namespace build2
const prerequisite_key&) const;
target*
- search_library (optional<dir_paths>& spc,
+ search_library (const dir_paths& sysd,
+ optional<dir_paths>& usrd,
prerequisite& p,
lorder lo) const
{
if (p.target == nullptr) // First check the cache.
- p.target = search_library (spc, p.key (), lo);
+ p.target = search_library (sysd, usrd, p.key (), lo);
return p.target;
}
- // Note that pk's scope should not be NULL (even if dir is absolute).
- //
target*
- search_library (optional<dir_paths>&,
+ search_library (const dir_paths&,
+ optional<dir_paths>&,
const prerequisite_key&,
lorder) const;