diff options
Diffstat (limited to 'libbuild2/cc/types.cxx')
-rw-r--r-- | libbuild2/cc/types.cxx | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/libbuild2/cc/types.cxx b/libbuild2/cc/types.cxx index 666b048..c6cfae9 100644 --- a/libbuild2/cc/types.cxx +++ b/libbuild2/cc/types.cxx @@ -6,6 +6,7 @@ #include <libbuild2/cc/utility.hxx> using namespace std; +using namespace butl; namespace build2 { @@ -56,7 +57,7 @@ namespace build2 } auto importable_headers:: - insert_angle (const dir_paths& sys_inc_dirs, + insert_angle (const dir_paths& sys_hdr_dirs, const string& s) -> pair<const path, groups>* { assert (s.front () == '<' && s.back () == '>'); @@ -68,8 +69,8 @@ namespace build2 { path f (s, 1, s.size () - 2); - path p; - for (const dir_path& d: sys_inc_dirs) + path p; // Reuse the buffer. + for (const dir_path& d: sys_hdr_dirs) { if (file_exists ((p = d, p /= f), true /* follow_symlinks */, @@ -121,8 +122,10 @@ namespace build2 } size_t importable_headers:: - insert_angle_pattern (const dir_paths& sys_inc_dirs, const string& pat) + insert_angle_pattern (const dir_paths& sys_hdr_dirs, const string& pat) { + tracer trace ("importable_headers::insert_angle_pattern"); + assert (pat.front () == '<' && pat.back () == '>' && path_pattern (pat)); // First see if it has already been inserted. @@ -166,13 +169,23 @@ namespace build2 return true; }; - for (const dir_path& dir: sys_inc_dirs) + for (const dir_path& dir: sys_hdr_dirs) { d.dir = &dir; try { - path_search (f, process, dir); + path_search ( + f, + process, + dir, + path_match_flags::follow_symlinks, + [&trace] (const dir_entry& de) + { + l5 ([&]{trace << "skipping inaccessible/dangling entry " + << de.base () / de.path ();}); + return true; + }); } catch (const system_error& e) { |