aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/utility.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/utility.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/utility.hxx')
-rw-r--r--libbuild2/cc/utility.hxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/libbuild2/cc/utility.hxx b/libbuild2/cc/utility.hxx
index 458aa25..a856fd0 100644
--- a/libbuild2/cc/utility.hxx
+++ b/libbuild2/cc/utility.hxx
@@ -32,10 +32,19 @@ namespace build2
extern const dir_path module_build_dir; // cc/build/
extern const dir_path module_build_modules_dir; // cc/build/modules/
- // Compile output type from source target.
+ // Compile output type from output target type (obj*{}, bmi*{}, etc).
+ //
+ // If input unit type is specified, then restrict the tests only to output
+ // types that can be produced from this input.
//
otype
- compile_type (const target&, unit_type);
+ compile_type (const target_type&, optional<unit_type> = nullopt);
+
+ inline otype
+ compile_type (const target& t, optional<unit_type> ut = nullopt)
+ {
+ return compile_type (t.type (), ut);
+ }
compile_target_types
compile_types (otype);