diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2018-05-17 14:26:09 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2018-05-18 11:59:53 +0300 |
commit | 093d031ec45b74bb5c880c3ce3ca7f181c600e9f (patch) | |
tree | 404fce7c19ca6818ac87bcbb6b5a9359004371dc /build2/target.txx | |
parent | 86f4d81621ea61c8c81243910126cdd865f86a22 (diff) |
Pass ignore_dangling flag to dir_iterator() ctor
Diffstat (limited to 'build2/target.txx')
-rw-r--r-- | build2/target.txx | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/build2/target.txx b/build2/target.txx index a5d6728..d93d300 100644 --- a/build2/target.txx +++ b/build2/target.txx @@ -158,17 +158,25 @@ namespace build2 // prerequisites_type ps; - for (const dir_entry& e: dir_iterator (base.src_path ())) + try { - 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)); + 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; } if (ps.empty ()) |