From c2001eb367b9b82e26689cad6f1f74f46c72b904 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 27 Apr 2017 08:29:52 +0200 Subject: Pass target to prerequisite search --- build2/algorithm.ixx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'build2/algorithm.ixx') diff --git a/build2/algorithm.ixx b/build2/algorithm.ixx index e1f8ddc..d39bf9c 100644 --- a/build2/algorithm.ixx +++ b/build2/algorithm.ixx @@ -8,7 +8,7 @@ namespace build2 { inline const target& - search (const prerequisite& p) + search (const target& t, const prerequisite& p) { assert (phase == run_phase::match); @@ -16,7 +16,7 @@ namespace build2 if (r == nullptr) { - r = &search (p.key ()); + r = &search (t, p.key ()); const target* e (nullptr); if (!p.target.compare_exchange_strong ( @@ -30,15 +30,17 @@ namespace build2 } inline const target& - search (const target_type& t, const prerequisite_key& k) + search (const target& t, const target_type& tt, const prerequisite_key& k) { return search ( + t, prerequisite_key { - k.proj, {&t, k.tk.dir, k.tk.out, k.tk.name, k.tk.ext}, k.scope}); + k.proj, {&tt, k.tk.dir, k.tk.out, k.tk.name, k.tk.ext}, k.scope}); } inline const target& - search (const target_type& type, + search (const target& t, + const target_type& type, const dir_path& dir, const dir_path& out, const string& name, @@ -47,6 +49,7 @@ namespace build2 const optional& proj) { return search ( + t, prerequisite_key { proj, { @@ -61,14 +64,15 @@ namespace build2 template inline const T& - search (const dir_path& dir, + search (const target& t, + const dir_path& dir, const dir_path& out, const string& name, const string* ext, const scope* scope) { return search ( - T::static_type, dir, out, name, ext, scope).template as (); + t, T::static_type, dir, out, name, ext, scope).template as (); } target_lock -- cgit v1.1