diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2020-06-16 09:43:27 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2020-06-16 09:43:27 +0200 |
commit | ecfae2da0b23631cee3e723a562f64f8aace6879 (patch) | |
tree | 6f7bae1bec966bcc456b71fbaabf8556f031d61b /libbuild2/cc/utility.hxx | |
parent | bd9ca1e55dc1396da73c4699ccc021dc1f604fe6 (diff) |
Move common functionality from cc to bin
Diffstat (limited to 'libbuild2/cc/utility.hxx')
-rw-r--r-- | libbuild2/cc/utility.hxx | 41 |
1 files changed, 8 insertions, 33 deletions
diff --git a/libbuild2/cc/utility.hxx b/libbuild2/cc/utility.hxx index 5aef14c..458aa25 100644 --- a/libbuild2/cc/utility.hxx +++ b/libbuild2/cc/utility.hxx @@ -9,7 +9,9 @@ #include <libbuild2/utility.hxx> #include <libbuild2/target.hxx> + #include <libbuild2/bin/target.hxx> +#include <libbuild2/bin/utility.hxx> #include <libbuild2/cc/types.hxx> @@ -17,6 +19,11 @@ namespace build2 { namespace cc { + using bin::link_type; + using bin::link_order; + using bin::link_info; + using bin::link_member; + // To form the complete path do: // // root.out_path () / root.root_extra->build_dir / X_dir @@ -25,45 +32,13 @@ 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. + // Compile output type from source target. // otype compile_type (const target&, unit_type); compile_target_types compile_types (otype); - - // Link output type. - // - ltype - link_type (const target&); - - // Library link order. - // - // The reason we pass scope and not the target is because this function is - // called not only for exe/lib but also for obj as part of the library - // metadata protocol implementation. Normally the bin.*.lib values will be - // project-wide. With this scheme they can be customized on the per- - // directory basis but not per-target which means all exe/lib in the same - // directory have to have the same link order. - // - lorder - link_order (const scope& base, otype); - - inline linfo - link_info (const scope& base, otype ot) - { - return linfo {ot, link_order (base, ot)}; - } - - // Given the link order return the library member to link. That is, liba{} - // or libs{} for lib{} and libua{} or libus{} for libul{}. - // - // If existing is true, then only return the member target if it exists - // (currently only used and supported for utility libraries). - // - const target* - link_member (const bin::libx&, action, linfo, bool existing = false); } } |