aboutsummaryrefslogtreecommitdiff
path: root/build2/target.txx
diff options
context:
space:
mode:
Diffstat (limited to 'build2/target.txx')
-rw-r--r--build2/target.txx28
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 ())