diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-08-28 15:03:29 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-08-28 15:03:29 +0200 |
commit | 9dadc037cdf49b8e6d869d4226e2afeadaa0780a (patch) | |
tree | 1a5348d9b1688957641b72ad018e2b0afddba61f /build2/cc/common | |
parent | ba83ffbaf5941366a399e3bc340bed3f55cc977c (diff) |
Factor library search/processing out to cc::common
Diffstat (limited to 'build2/cc/common')
-rw-r--r-- | build2/cc/common | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/build2/cc/common b/build2/cc/common index 5e38840..6e042ee 100644 --- a/build2/cc/common +++ b/build2/cc/common @@ -10,6 +10,8 @@ #include <build2/variable> +#include <build2/bin/target> + #include <build2/cc/types> namespace build2 @@ -175,6 +177,73 @@ namespace build2 if (!tstd.empty ()) cs.append (tstd); } + + // Library handling. + // + public: + void + process_libraries (scope&, + lorder, + const dir_paths&, + file&, + bool, + const function<bool (file&, bool)>&, + const function<void (file*, const string&, bool)>&, + const function<void (file&, + const string&, + bool, + bool)>&, + bool = false) const; + + target* + search_library (const dir_paths& sysd, + optional<dir_paths>& usrd, + prerequisite& p) const + { + if (p.target == nullptr) // First check the cache. + p.target = search_library (sysd, usrd, p.key ()); + + return p.target; + } + + private: + file& + resolve_library (name, + scope&, + lorder, + const dir_paths&, + optional<dir_paths>&) const; + + target* + search_library (const dir_paths&, + optional<dir_paths>&, + const prerequisite_key&) const; + + dir_paths + extract_library_dirs (scope&) const; + + bool + pkgconfig_extract (scope&, + bin::lib&, + bin::liba*, + bin::libs*, + const string*, + const string&, + const dir_path&, + const dir_paths&) const; // pkgconfig.cxx + + // Alternative search logic for VC (msvc.cxx). + // + bin::liba* + msvc_search_static (const process_path&, + const dir_path&, + const prerequisite_key&) const; + + bin::libs* + msvc_search_shared (const process_path&, + const dir_path&, + const prerequisite_key&) const; + }; } } |