From fb3a7f3343f9ee0cfd15b540a3209e438f6063eb Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 12 Nov 2020 09:27:20 +0200 Subject: Assign fixed extensions to wasm{} and pdb{} target types --- libbuild2/bin/init.cxx | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'libbuild2/bin/init.cxx') 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 ("wasm").first); + const target_type& wasm ( + rs.derive_target_type( + target_type { + "wasm", + &file::static_type, + nullptr, /* factory */ + &target_extension_fix, + nullptr, /* default_extension */ + &target_pattern_fix, + &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 ("pdb").first); + const target_type& pdb ( + rs.derive_target_type( + target_type { + "pdb", + &file::static_type, + nullptr, /* factory */ + &target_extension_fix, + nullptr, /* default_extension */ + &target_pattern_fix, + &target_print_0_ext_verb, // Fixed extension, no use printing. + &file_search, + false /* see_through */})); if (cast_false (rs["install.loaded"])) { -- cgit v1.1