diff options
Diffstat (limited to 'build/algorithm.ixx')
-rw-r--r-- | build/algorithm.ixx | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/build/algorithm.ixx b/build/algorithm.ixx index 9435b2e..3907209 100644 --- a/build/algorithm.ixx +++ b/build/algorithm.ixx @@ -11,12 +11,31 @@ namespace build search (prerequisite& p) { if (p.target == nullptr) - p.target = &search ( - prerequisite_key {{&p.type, &p.dir, &p.name, &p.ext}, &p.scope}); + p.target = &search (p.key ()); return *p.target; } + inline target& + search (const target_type& type, + const dir_path& dir, + const std::string& name, + const std::string* ext, + scope* scope) + { + return search (prerequisite_key {{&type, &dir, &name, &ext}, scope}); + } + + template <typename T> + inline T& + search (const dir_path& dir, + const std::string& name, + const std::string* ext, + scope* scope) + { + return static_cast<T&> (search (T::static_type, dir, name, ext, scope)); + } + void match_impl (action, target&); |