diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2020-11-11 15:14:19 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2020-11-11 15:14:19 +0200 |
commit | cd10a583ad1f3c299383c07fd8c6ccd6e3199e6b (patch) | |
tree | acf33fe1a9c03fadf8e96ea1b78a89ff7de95372 /libbuild2/cc/compile-rule.hxx | |
parent | 60a95915aa1fda93d308158416071ba39286d41c (diff) |
Add ${c,cxx}.lib_{poptions,libs,rpaths}() functions
These functions can be used to query library metadata for options and
libraries that should be used when compiling/linking dependent targets,
similar to how cc::{compile,link}_rule do it. With this support it should
be possible to more or less re-create their semantics in ad hoc recipes.
Diffstat (limited to 'libbuild2/cc/compile-rule.hxx')
-rw-r--r-- | libbuild2/cc/compile-rule.hxx | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/libbuild2/cc/compile-rule.hxx b/libbuild2/cc/compile-rule.hxx index d6cb002..cbbb142 100644 --- a/libbuild2/cc/compile-rule.hxx +++ b/libbuild2/cc/compile-rule.hxx @@ -53,6 +53,15 @@ namespace build2 target_state perform_clean (action, const target&) const; + public: + void + append_lib_options (strings&, + const scope&, + action, const file&, bool, linfo) const; + protected: + static void + functions (function_family&, const char*); // functions.cxx + private: struct match_data; using environment = small_vector<const char*, 2>; @@ -63,11 +72,15 @@ namespace build2 template <typename T> void - append_lib_options (const scope&, - T&, - action, - const target&, - linfo) const; + append_lib_options (T&, + const scope&, + action, const file&, bool, linfo) const; + + template <typename T> + void + append_lib_options (T&, + const scope&, + action, const target&, linfo) const; // Mapping of include prefixes (e.g., foo in <foo/bar>) for auto- // generated headers to directories where they will be generated. @@ -94,11 +107,9 @@ namespace build2 append_prefixes (prefix_map&, const target&, const variable&) const; void - append_lib_prefixes (const scope&, - prefix_map&, - action, - target&, - linfo) const; + append_lib_prefixes (prefix_map&, + const scope&, + action, target&, linfo) const; prefix_map build_prefix_map (const scope&, action, target&, linfo) const; @@ -168,7 +179,7 @@ namespace build2 action, const file&, const match_data&, const path&) const; - // Compiler-specific language selection option. Return the number of + // Compiler-specific language selection options. Return the number of // options (arguments, really) appended. // size_t |