From a5949f9e974171144dba84771a9f305f9e1dcc3f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 27 Jan 2016 13:59:51 +0200 Subject: Rework default extension derivation, again --- build2/bin/target.cxx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'build2/bin') diff --git a/build2/bin/target.cxx b/build2/bin/target.cxx index de51fc7..ed36f80 100644 --- a/build2/bin/target.cxx +++ b/build2/bin/target.cxx @@ -10,6 +10,8 @@ namespace build2 { namespace bin { + constexpr const char ext_var[] = "extension"; + static target* obja_factory (const target_type&, dir_path d, string n, const string* e) { @@ -27,7 +29,7 @@ namespace build2 "obja", &file::static_type, &obja_factory, - &target_extension_assert, + &target_extension_var, nullptr, &search_target, // Note: not _file(); don't look for an existing file. false @@ -50,7 +52,7 @@ namespace build2 "objso", &file::static_type, &objso_factory, - &target_extension_assert, + &target_extension_var, nullptr, &search_target, // Note: not _file(); don't look for an existing file. false @@ -94,13 +96,12 @@ namespace build2 // (or any module that knows how to build exe{}) changes it to the // 'host'. Maybe that's not a bad idea? // - constexpr const char exe_ext[] = ""; const target_type exe::static_type { "exe", &file::static_type, &target_factory, - &target_extension_fix, + &target_extension_var, nullptr, &search_file, false @@ -132,13 +133,12 @@ namespace build2 // come from a variable that is set not by bin but by the module // whose rule matched the target (e.g., cxx::link). // - constexpr const char a_ext[] = "a"; const target_type liba::static_type { "liba", &file::static_type, &liba_factory, - &target_extension_fix, + &target_extension_var, nullptr, &search_file, false @@ -158,13 +158,12 @@ namespace build2 return so; } - constexpr const char so_ext[] = "so"; const target_type libso::static_type { "libso", &file::static_type, &libso_factory, - &target_extension_fix, + &target_extension_var, nullptr, &search_file, false -- cgit v1.1