aboutsummaryrefslogtreecommitdiff
path: root/build/target
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-12-01 14:46:45 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-12-01 14:46:45 +0200
commit10fd2aface4486fc7f873dd2b54a1c2073c0b434 (patch)
tree5133810cf33b3e4ba4dfe78f659ee65599c31ffd /build/target
parent7996c2bfc2d7e998e2f9f1236d457ec7bea8ad8a (diff)
Reimplement define as dynamic derivation rather than alias
New syntax: define cli: file The rationale is we need to be able to assign the file extension (using type/pattern-specific variables). And if it is an alias, we will assign it to the original target type. Note that we could still support aliases if we need to. Will need to bring back the id member in target_type that would normally point to itself but for an alias would point to the origin.
Diffstat (limited to 'build/target')
-rw-r--r--build/target7
1 files changed, 3 insertions, 4 deletions
diff --git a/build/target b/build/target
index a1c7880..66daa66 100644
--- a/build/target
+++ b/build/target
@@ -354,15 +354,14 @@ namespace build
const T*
is_a () const {return dynamic_cast<const T*> (this);}
- // An alias target type should be the same as its target type except
- // for the name.
+ // Dynamic derivation to support define.
//
- const target_type* alias_type = nullptr;
+ const target_type* derived_type = nullptr;
const target_type&
type () const
{
- return alias_type != nullptr ? *alias_type : dynamic_type ();
+ return derived_type != nullptr ? *derived_type : dynamic_type ();
}
virtual const target_type& dynamic_type () const = 0;