diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-07-28 13:46:26 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-07-28 13:46:26 +0200 |
commit | 1c7cbb302b1c6e41eb0c5cecfc655532f1919cba (patch) | |
tree | 84375e8be2bfe00b2387f02cab8dcca396019299 /build2/algorithm.cxx | |
parent | 24402ed431c1780914576f72350f8796308cb59b (diff) |
Implement support for linking whole archive
Diffstat (limited to 'build2/algorithm.cxx')
-rw-r--r-- | build2/algorithm.cxx | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/build2/algorithm.cxx b/build2/algorithm.cxx index fa9787b..5e18441 100644 --- a/build2/algorithm.cxx +++ b/build2/algorithm.cxx @@ -19,32 +19,6 @@ using namespace butl; namespace build2 { - const target* - search_existing (const prerequisite& p) - { - assert (phase == run_phase::match); // Could be relaxed. - - const target* r (p.target.load (memory_order_consume)); - - if (r == nullptr) - { - const prerequisite_key& pk (p.key ()); - r = pk.proj ? import_existing (pk) : search_existing_target (pk); - - if (r != nullptr) - { - const target* e (nullptr); - if (!p.target.compare_exchange_strong ( - e, r, - memory_order_release, - memory_order_consume)) - assert (e == r); - } - } - - return r; - } - const target& search (const target& t, const prerequisite_key& pk) { @@ -62,6 +36,14 @@ namespace build2 return create_new_target (pk); } + const target* + search_existing (const prerequisite_key& pk) + { + assert (phase == run_phase::match || phase == run_phase::execute); + + return pk.proj ? import_existing (pk) : search_existing_target (pk); + } + const target& search (const target& t, name n, const scope& s) { |