aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/link-rule.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-11-11 15:14:19 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-11-11 15:14:19 +0200
commitcd10a583ad1f3c299383c07fd8c6ccd6e3199e6b (patch)
treeacf33fe1a9c03fadf8e96ea1b78a89ff7de95372 /libbuild2/cc/link-rule.hxx
parent60a95915aa1fda93d308158416071ba39286d41c (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/link-rule.hxx')
-rw-r--r--libbuild2/cc/link-rule.hxx46
1 files changed, 27 insertions, 19 deletions
diff --git a/libbuild2/cc/link-rule.hxx b/libbuild2/cc/link-rule.hxx
index db48160..a93defc 100644
--- a/libbuild2/cc/link-rule.hxx
+++ b/libbuild2/cc/link-rule.hxx
@@ -51,6 +51,33 @@ namespace build2
using simple_rule::match; // To make Clang happy.
+ public:
+ // Library handling.
+ //
+ void
+ append_libraries (strings&,
+ const scope&, action,
+ const file&, bool, lflags, linfo, bool = true) const;
+
+ void
+ append_libraries (sha256&, bool&, timestamp,
+ const scope&, action,
+ const file&, bool, lflags, linfo) const;
+
+ void
+ rpath_libraries (strings&,
+ const scope&,
+ action, const file&, bool, linfo, bool, bool) const;
+
+ void
+ rpath_libraries (strings&,
+ const scope&, action,
+ const target&, linfo, bool) const;
+
+ protected:
+ static void
+ functions (function_family&, const char*); // functions.cxx
+
private:
friend class install_rule;
friend class libux_install_rule;
@@ -126,25 +153,6 @@ namespace build2
link_rule::libs_paths libs_paths;
};
- // Library handling.
- //
- void
- append_libraries (strings&,
- const file&, bool, lflags,
- const scope&, action, linfo) const;
-
- void
- append_libraries (sha256&,
- bool&, timestamp,
- const file&, bool, lflags,
- const scope&, action, linfo) const;
-
- void
- rpath_libraries (strings&,
- const target&,
- const scope&, action, linfo,
- bool) const;
-
// Windows rpath emulation (windows-rpath.cxx).
//
struct windows_dll