aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/algorithm.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-06-23 06:36:20 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-06-23 06:36:20 +0200
commite872913956c05c6fe1826ff3f2a3e67953e31064 (patch)
treea39163fa82d7fa3fffaf093a85f9c84d2818d639 /libbuild2/algorithm.ixx
parent735927b150d2262a317a99b563af57a97e8dd67c (diff)
Minor enhancements to algorithms
Diffstat (limited to 'libbuild2/algorithm.ixx')
-rw-r--r--libbuild2/algorithm.ixx15
1 files changed, 15 insertions, 0 deletions
diff --git a/libbuild2/algorithm.ixx b/libbuild2/algorithm.ixx
index 10ed754..ea4241e 100644
--- a/libbuild2/algorithm.ixx
+++ b/libbuild2/algorithm.ixx
@@ -187,6 +187,21 @@ namespace build2
t, T::static_type, dir, out, name, ext, scope).template as<T> ();
}
+ template <typename T>
+ inline const T*
+ search_existing (context& ctx,
+ const dir_path& dir,
+ const dir_path& out,
+ const string& name,
+ const string* ext,
+ const scope* scope)
+ {
+ const target* r (
+ search_existing (
+ ctx, T::static_type, dir, out, name, ext, scope));
+ return r != nullptr ? &r->template as<T> () : nullptr;
+ }
+
LIBBUILD2_SYMEXPORT target_lock
lock_impl (action, const target&, optional<scheduler::work_queue>);