aboutsummaryrefslogtreecommitdiff
path: root/build2/cc/target.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/cc/target.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/cc/target.cxx')
-rw-r--r--build2/cc/target.cxx24
1 files changed, 16 insertions, 8 deletions
diff --git a/build2/cc/target.cxx b/build2/cc/target.cxx
index 6f8d541..38236a0 100644
--- a/build2/cc/target.cxx
+++ b/build2/cc/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/cc/target.hxx>
using namespace std;
@@ -18,33 +20,36 @@ namespace build2
nullptr,
nullptr,
nullptr,
+ nullptr,
&target_search,
false
};
- extern const char ext_var[] = "extension"; // VC14 rejects constexpr.
-
extern const char h_ext_def[] = "h";
+
const target_type h::static_type
{
"h",
&file::static_type,
&target_factory<h>,
- &target_extension_var<ext_var, h_ext_def>,
- &target_pattern_var<ext_var, h_ext_def>,
+ nullptr, /* fixed_extension */
+ &target_extension_var<var_extension, h_ext_def>,
+ &target_pattern_var<var_extension, h_ext_def>,
nullptr,
&file_search,
false
};
extern const char c_ext_def[] = "c";
+
const target_type c::static_type
{
"c",
&cc::static_type,
&target_factory<c>,
- &target_extension_var<ext_var, c_ext_def>,
- &target_pattern_var<ext_var, c_ext_def>,
+ nullptr, /* fixed_extension */
+ &target_extension_var<var_extension, c_ext_def>,
+ &target_pattern_var<var_extension, c_ext_def>,
nullptr,
&file_search,
false
@@ -58,6 +63,7 @@ namespace build2
nullptr,
nullptr,
nullptr,
+ nullptr,
&target_search,
false
};
@@ -68,8 +74,9 @@ namespace build2
{
"pca",
&pc::static_type,
- &file_factory<pca, pca_ext>,
+ &target_factory<pca>,
&target_extension_fix<pca_ext>,
+ nullptr, /* default_extension */
&target_pattern_fix<pca_ext>,
&target_print_0_ext_verb, // Fixed extension, no use printing.
&file_search,
@@ -82,8 +89,9 @@ namespace build2
{
"pcs",
&pc::static_type,
- &file_factory<pcs, pcs_ext>,
+ &target_factory<pcs>,
&target_extension_fix<pcs_ext>,
+ nullptr, /* default_extension */
&target_pattern_fix<pcs_ext>,
&target_print_0_ext_verb, // Fixed extension, no use printing.
&file_search,