aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/algorithm.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-12-11 07:07:36 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-12-11 07:07:36 +0200
commit3074c5e1409ad49c0793db6384ecbc6ac4ed33a9 (patch)
tree256d707b43c3139fc7591d7ebd2a6c85456bc90b /libbuild2/algorithm.ixx
parentb971493841a601041cac1f680e3828e8d223e6f2 (diff)
Add search_locked() versions of search() functions
Diffstat (limited to 'libbuild2/algorithm.ixx')
-rw-r--r--libbuild2/algorithm.ixx32
1 files changed, 32 insertions, 0 deletions
diff --git a/libbuild2/algorithm.ixx b/libbuild2/algorithm.ixx
index eb20ad0..396d518 100644
--- a/libbuild2/algorithm.ixx
+++ b/libbuild2/algorithm.ixx
@@ -34,6 +34,17 @@ namespace build2
k.proj, {&tt, k.tk.dir, k.tk.out, k.tk.name, k.tk.ext}, k.scope});
}
+ inline pair<target&, ulock>
+ search_locked (const target& t,
+ const target_type& tt,
+ const prerequisite_key& k)
+ {
+ return search_locked (
+ t,
+ prerequisite_key {
+ k.proj, {&tt, k.tk.dir, k.tk.out, k.tk.name, k.tk.ext}, k.scope});
+ }
+
inline const target&
search (const target& t,
const target_type& type,
@@ -56,6 +67,27 @@ namespace build2
scope});
}
+ inline pair<target&, ulock>
+ search_locked (const target& t,
+ const target_type& type,
+ const dir_path& dir,
+ const dir_path& out,
+ const string& name,
+ const string* ext,
+ const scope* scope)
+ {
+ return search_locked (
+ t,
+ prerequisite_key {
+ nullopt,
+ {
+ &type,
+ &dir, &out, &name,
+ ext != nullptr ? optional<string> (*ext) : nullopt
+ },
+ scope});
+ }
+
inline const target*
search_existing (context& ctx,
const target_type& type,