From 3074c5e1409ad49c0793db6384ecbc6ac4ed33a9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 11 Dec 2020 07:07:36 +0200 Subject: Add search_locked() versions of search() functions --- libbuild2/algorithm.ixx | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'libbuild2/algorithm.ixx') 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 + 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 + 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 (*ext) : nullopt + }, + scope}); + } + inline const target* search_existing (context& ctx, const target_type& type, -- cgit v1.1