diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2020-11-12 09:27:20 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2020-11-12 09:27:20 +0200 |
commit | fb3a7f3343f9ee0cfd15b540a3209e438f6063eb (patch) | |
tree | b60012bdf95e649dfc73c03a08b1a6cd9d28c12f /libbuild2/bin/init.cxx | |
parent | cd10a583ad1f3c299383c07fd8c6ccd6e3199e6b (diff) |
Assign fixed extensions to wasm{} and pdb{} target types
Diffstat (limited to 'libbuild2/bin/init.cxx')
-rw-r--r-- | libbuild2/bin/init.cxx | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/libbuild2/bin/init.cxx b/libbuild2/bin/init.cxx index 166ec5d..9c16432 100644 --- a/libbuild2/bin/init.cxx +++ b/libbuild2/bin/init.cxx @@ -415,6 +415,8 @@ namespace build2 return true; } + extern const char wasm_ext[] = "wasm"; // VC14 rejects constexpr. + bool init (scope& rs, scope& bs, @@ -522,7 +524,18 @@ namespace build2 if (tgt.cpu == "wasm32" || tgt.cpu == "wasm64") { - const target_type& wasm (bs.derive_target_type<file> ("wasm").first); + const target_type& wasm ( + rs.derive_target_type( + target_type { + "wasm", + &file::static_type, + nullptr, /* factory */ + &target_extension_fix<wasm_ext>, + nullptr, /* default_extension */ + &target_pattern_fix<wasm_ext>, + &target_print_0_ext_verb, // Fixed extension, no use printing. + &file_search, + false /* see_through */})); if (install_loaded) { @@ -855,6 +868,8 @@ namespace build2 return true; } + extern const char pdb_ext[] = "pdb"; // VC14 rejects constexpr. + bool ld_init (scope& rs, scope& bs, @@ -879,7 +894,18 @@ namespace build2 if (lid == "msvc") { - const target_type& pdb (bs.derive_target_type<file> ("pdb").first); + const target_type& pdb ( + rs.derive_target_type( + target_type { + "pdb", + &file::static_type, + nullptr, /* factory */ + &target_extension_fix<pdb_ext>, + nullptr, /* default_extension */ + &target_pattern_fix<pdb_ext>, + &target_print_0_ext_verb, // Fixed extension, no use printing. + &file_search, + false /* see_through */})); if (cast_false<bool> (rs["install.loaded"])) { |