aboutsummaryrefslogtreecommitdiff
path: root/build2/cxx
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/cxx
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/cxx')
-rw-r--r--build2/cxx/target.cxx29
1 files changed, 17 insertions, 12 deletions
diff --git a/build2/cxx/target.cxx b/build2/cxx/target.cxx
index bde41fc..b7c3f8c 100644
--- a/build2/cxx/target.cxx
+++ b/build2/cxx/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/cxx/target.hxx>
using namespace std;
@@ -10,16 +12,15 @@ namespace build2
{
namespace cxx
{
- extern const char ext_var[] = "extension"; // VC14 rejects constexpr.
-
extern const char hxx_ext_def[] = "hxx";
const target_type hxx::static_type
{
"hxx",
&file::static_type,
&target_factory<hxx>,
- &target_extension_var<ext_var, hxx_ext_def>,
- &target_pattern_var<ext_var, hxx_ext_def>,
+ nullptr, /* fixed_extension */
+ &target_extension_var<var_extension, hxx_ext_def>,
+ &target_pattern_var<var_extension, hxx_ext_def>,
nullptr,
&file_search,
false
@@ -31,8 +32,9 @@ namespace build2
"ixx",
&file::static_type,
&target_factory<ixx>,
- &target_extension_var<ext_var, ixx_ext_def>,
- &target_pattern_var<ext_var, ixx_ext_def>,
+ nullptr, /* fixed_extension */
+ &target_extension_var<var_extension, ixx_ext_def>,
+ &target_pattern_var<var_extension, ixx_ext_def>,
nullptr,
&file_search,
false
@@ -44,8 +46,9 @@ namespace build2
"txx",
&file::static_type,
&target_factory<txx>,
- &target_extension_var<ext_var, txx_ext_def>,
- &target_pattern_var<ext_var, txx_ext_def>,
+ nullptr, /* fixed_extension */
+ &target_extension_var<var_extension, txx_ext_def>,
+ &target_pattern_var<var_extension, txx_ext_def>,
nullptr,
&file_search,
false
@@ -57,8 +60,9 @@ namespace build2
"cxx",
&cc::static_type,
&target_factory<cxx>,
- &target_extension_var<ext_var, cxx_ext_def>,
- &target_pattern_var<ext_var, cxx_ext_def>,
+ nullptr, /* fixed_extension */
+ &target_extension_var<var_extension, cxx_ext_def>,
+ &target_pattern_var<var_extension, cxx_ext_def>,
nullptr,
&file_search,
false
@@ -70,8 +74,9 @@ namespace build2
"mxx",
&file::static_type,
&target_factory<mxx>,
- &target_extension_var<ext_var, mxx_ext_def>,
- &target_pattern_var<ext_var, mxx_ext_def>,
+ nullptr, /* fixed_extension */
+ &target_extension_var<var_extension, mxx_ext_def>,
+ &target_pattern_var<var_extension, mxx_ext_def>,
nullptr,
&file_search,
false