aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/scope.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/scope.cxx')
-rw-r--r--libbuild2/scope.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/libbuild2/scope.cxx b/libbuild2/scope.cxx
index f8fc634..53c859f 100644
--- a/libbuild2/scope.cxx
+++ b/libbuild2/scope.cxx
@@ -929,6 +929,15 @@ namespace build2
return root_extra->target_types.insert (name, move (dt));
}
+ const target_type& scope::
+ derive_target_type (const target_type& et)
+ {
+ assert (root_scope () == this);
+ unique_ptr<target_type> dt (new target_type (et));
+ dt->factory = &derived_tt_factory;
+ return root_extra->target_types.insert (et.name, move (dt)).first;
+ }
+
// scope_map
//