diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-11-14 13:08:29 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-11-14 13:08:29 +0200 |
commit | b611e797ad9db9794f4d151f454fa731d12b0bd3 (patch) | |
tree | b202ef1d894a313fb791d5f0af254f67d2ae84b7 /build2/target.txx | |
parent | 6c3d3f62f8560cbb8d1e983a8dd8cc98266bfe37 (diff) |
Fallback to loading outer buildfile if there isn't one in src_base
This covers the case where the target is defined in the outer buildfile which
is common with non-intrusive project conversions where everything is built
from a single root buildfile.
Diffstat (limited to 'build2/target.txx')
-rw-r--r-- | build2/target.txx | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/build2/target.txx b/build2/target.txx index a29a289..921d585 100644 --- a/build2/target.txx +++ b/build2/target.txx @@ -156,34 +156,13 @@ namespace build2 // template <typename K> const target* dir:: - search_implied (const scope& base, const K& k, tracer& trace) + search_implied (const scope& bs, const K& k, tracer& trace) { using namespace butl; - // See if we have any subdirectories. + // See if we have any prerequisites. // - prerequisites_type ps; - - try - { - for (const dir_entry& e: dir_iterator (base.src_path (), - true /* ignore_dangling */)) - { - if (e.type () == entry_type::directory) - ps.push_back ( - prerequisite (nullopt, - dir::static_type, - dir_path (e.path ().representation ()), - dir_path (), // In the out tree. - string (), - nullopt, - base)); - } - } - catch (const system_error& e) - { - fail << "unable to iterate over " << base.src_path () << ": " << e; - } + prerequisites_type ps (collect_implied (bs)); if (ps.empty ()) return nullptr; @@ -194,7 +173,7 @@ namespace build2 // buildfile. Thus not implied. // target& t (targets.insert (dir::static_type, - base.out_path (), + bs.out_path (), dir_path (), string (), nullopt, |