From a89f1e4f4efd291beedea03c65c8185b7d0df20e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 7 Dec 2017 12:06:59 +0200 Subject: Distinguish between "fixed" and "default" target extensions This fixes wrong merging of, say, file{README} and file{README.MySQL} (in libmysqlclient). --- build2/cli/target.cxx | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'build2/cli') diff --git a/build2/cli/target.cxx b/build2/cli/target.cxx index 10aab5e..c35ee18 100644 --- a/build2/cli/target.cxx +++ b/build2/cli/target.cxx @@ -2,6 +2,8 @@ // copyright : Copyright (c) 2014-2017 Code Synthesis Ltd // license : MIT; see accompanying LICENSE file +#include + #include using namespace std; @@ -13,7 +15,6 @@ namespace build2 { // cli // - extern const char cli_ext_var[] = "extension"; // VC14 rejects constexpr. extern const char cli_ext_def[] = "cli"; const target_type cli::static_type @@ -21,8 +22,9 @@ namespace build2 "cli", &file::static_type, &target_factory, - &target_extension_var, - &target_pattern_var, + nullptr, /* fixed_extension */ + &target_extension_var, + &target_pattern_var, nullptr, &file_search, false @@ -42,12 +44,8 @@ namespace build2 : group_view {nullptr, 0}; } - static pair> - cli_cxx_factory (const target_type&, - dir_path d, - dir_path o, - string n, - optional e) + static target* + cli_cxx_factory (const target_type&, dir_path d, dir_path o, string n) { tracer trace ("cli::cli_cxx_factory"); @@ -61,7 +59,7 @@ namespace build2 targets.insert (d, o, n, trace); targets.insert (d, o, n, trace); - return make_pair (new cli_cxx (move (d), move (o), move (n)), move (e)); + return new cli_cxx (move (d), move (o), move (n)); } const target_type cli_cxx::static_type @@ -72,6 +70,7 @@ namespace build2 nullptr, nullptr, nullptr, + nullptr, &target_search, true // "See through" default iteration mode. }; -- cgit v1.1