diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-06-22 09:24:12 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-06-22 09:24:12 +0200 |
commit | 6ecaa7e76c91a2842bcc63626a908bb2340b77b6 (patch) | |
tree | aa0e3d8d5f9f791dfa1735ce7d8cc276a2c0baf3 /build/algorithm.ixx | |
parent | 82ad80de9a967f253026c4874b47486c69402288 (diff) |
Remove prerequisite rewriting for c/cxx chaining
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&); |