aboutsummaryrefslogtreecommitdiff
path: root/build2/algorithm.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-04-27 08:29:52 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-04-27 08:29:52 +0200
commitc2001eb367b9b82e26689cad6f1f74f46c72b904 (patch)
treedb2ee46fc11989d85201ccebaf44f51b978fb313 /build2/algorithm.ixx
parent530e19cc8f53f066039967c41bb432111ce98626 (diff)
Pass target to prerequisite search
Diffstat (limited to 'build2/algorithm.ixx')
-rw-r--r--build2/algorithm.ixx18
1 files changed, 11 insertions, 7 deletions
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<string>& proj)
{
return search (
+ t,
prerequisite_key {
proj,
{
@@ -61,14 +64,15 @@ namespace build2
template <typename T>
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, T::static_type, dir, out, name, ext, scope).template as<T> ();
}
target_lock