aboutsummaryrefslogtreecommitdiff
path: root/build/parser.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'build/parser.cxx')
-rw-r--r--build/parser.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/build/parser.cxx b/build/parser.cxx
index c896c71..ee22254 100644
--- a/build/parser.cxx
+++ b/build/parser.cxx
@@ -818,6 +818,8 @@ namespace build
return r;
}
+ constexpr const char derived_ext_var[] = "extension";
+
void parser::
define (token& t, token_type& tt)
{
@@ -852,6 +854,11 @@ namespace build
dt->base = bt;
dt->factory = &derived_factory;
+ // Override extension derivation function: we most likely don't want
+ // to use the same default as our base (think cli: file).
+ //
+ dt->extension = &target_extension_var<derived_ext_var, nullptr>;
+
target_type& rdt (*dt); // Save a non-const reference to the object.
auto pr (scope_->target_types.emplace (dn, target_type_ref (move (dt))));