aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/module.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-11-08 08:32:00 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-11-08 08:32:00 +0200
commitc1d9c1a0db041def6a3bc9b19be9f14a75b72c1a (patch)
treeba45de36d1f87f1e38ba2673f88ce8f5d42eb660 /libbuild2/cc/module.cxx
parenta9185093df8d05497d9488fc85ca34795764632f (diff)
Redo Apple /usr/include detection using patterns
This should cover XCode 11 where the symlinks are the other way around now (see homebrew-core issue #46393 for details).
Diffstat (limited to 'libbuild2/cc/module.cxx')
-rw-r--r--libbuild2/cc/module.cxx24
1 files changed, 8 insertions, 16 deletions
diff --git a/libbuild2/cc/module.cxx b/libbuild2/cc/module.cxx
index 881583f..5ff5639 100644
--- a/libbuild2/cc/module.cxx
+++ b/libbuild2/cc/module.cxx
@@ -322,7 +322,7 @@ namespace build2
static const dir_path usr_loc_inc ("/usr/local/include");
# ifdef __APPLE__
static const dir_path a_usr_inc (
- "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include");
+ "/Library/Developer/CommandLineTools/SDKs/MacOSX*.sdk/usr/include");
# endif
#endif
@@ -475,11 +475,11 @@ namespace build2
// /Library/Developer/CommandLineTools/usr/include
// /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include
//
- // What exactly all this means is anyone's guess, of course. So for
- // now we will assume that anything that is or resolves (like that
- // MacOSX10.14.sdk symlink) to:
+ // What exactly all this means is anyone's guess, of course (see
+ // homebrew-core issue #46393 for some background). So for now we
+ // will assume that anything that matches this pattern:
//
- // /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
+ // /Library/Developer/CommandLineTools/SDKs/MacOSX*.sdk/usr/include
//
// Is Apple's /usr/include.
//
@@ -487,19 +487,11 @@ namespace build2
{
for (const dir_path& d: inc_dirs)
{
- // Both Clang and GCC skip non-existent paths but let's handle
- // (and ignore) directories that cause any errors, for good
- // measure.
- //
- try
+ if (path_match (d, a_usr_inc))
{
- if (d == a_usr_inc || dir_path (d).realize () == a_usr_inc)
- {
- ui = true;
- break;
- }
+ ui = true;
+ break;
}
- catch (...) {}
}
}
#endif