From 10fd2aface4486fc7f873dd2b54a1c2073c0b434 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 1 Dec 2015 14:46:45 +0200 Subject: 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. --- build/rule-map | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'build/rule-map') diff --git a/build/rule-map b/build/rule-map index 0ce49e7..d262ecd 100644 --- a/build/rule-map +++ b/build/rule-map @@ -9,7 +9,6 @@ #include #include #include // unique_ptr -#include #include // reference_wrapper #include @@ -22,7 +21,7 @@ namespace build class rule; using target_type_rule_map = std::map< - std::type_index, // Target type. + const target_type*, butl::prefix_map, '.'>>; @@ -41,7 +40,7 @@ namespace build if (oid >= map_.size ()) map_.resize ((oid < 3 ? 3 : oid) + 1); - map_[oid][typeid (T)].emplace (hint, r); + map_[oid][&T::static_type].emplace (hint, r); } // Return NULL if not found. -- cgit v1.1