aboutsummaryrefslogtreecommitdiff
path: root/build2/cli
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-12-07 12:06:59 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-12-07 12:06:59 +0200
commita89f1e4f4efd291beedea03c65c8185b7d0df20e (patch)
treed06b2cb81720ae0c6cc877c2c67201838a10b63a /build2/cli
parentc2da5df68610a0070575212bfee67c730ab39128 (diff)
Distinguish between "fixed" and "default" target extensions
This fixes wrong merging of, say, file{README} and file{README.MySQL} (in libmysqlclient).
Diffstat (limited to 'build2/cli')
-rw-r--r--build2/cli/target.cxx19
1 files changed, 9 insertions, 10 deletions
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 <build2/context.hxx>
+
#include <build2/cli/target.hxx>
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<cli>,
- &target_extension_var<cli_ext_var, cli_ext_def>,
- &target_pattern_var<cli_ext_var, cli_ext_def>,
+ nullptr, /* fixed_extension */
+ &target_extension_var<var_extension, cli_ext_def>,
+ &target_pattern_var<var_extension, cli_ext_def>,
nullptr,
&file_search,
false
@@ -42,12 +44,8 @@ namespace build2
: group_view {nullptr, 0};
}
- static pair<target*, optional<string>>
- cli_cxx_factory (const target_type&,
- dir_path d,
- dir_path o,
- string n,
- optional<string> 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<cxx::cxx> (d, o, n, trace);
targets.insert<cxx::ixx> (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.
};