Skip to content

Commit b4f961a

Browse files
committed
fix: include resource directory in search path for include resolution
This is an issue with more recent SDKs (observed from Xcode 15.3 15E204a shipped SDKs onwards) and explicit inclusion resolves it. We have to use `:=` to force immediate resolution.
1 parent 1bedfc3 commit b4f961a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

depends/hosts/darwin.mk

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ OSX_SDK=$(SDK_PATH)/Xcode-$(XCODE_VERSION)-$(XCODE_BUILD_ID)-extracted-SDK-with-
1313
# distro releases.
1414
#
1515
# Source: https://lists.gnu.org/archive/html/bug-make/2017-11/msg00017.html
16-
clang_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v clang")
17-
clangxx_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v clang++")
16+
clang_prog:=$(shell $(SHELL) $(.SHELLFLAGS) "command -v clang")
17+
clangxx_prog:=$(shell $(SHELL) $(.SHELLFLAGS) "command -v clang++")
18+
19+
clang_resource_dir:=$(shell $(SHELL) $(.SHELLFLAGS) "$(clang_prog) -print-resource-dir")
1820

1921
darwin_AR=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-ar")
2022
darwin_DSYMUTIL=$(shell $(SHELL) $(.SHELLFLAGS) "command -v dsymutil")
@@ -52,12 +54,14 @@ darwin_STRIP=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-strip")
5254
# non-determinism issues with the Identifier field.
5355

5456
darwin_CC=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH $(clang_prog) --target=$(host) \
55-
-isysroot$(OSX_SDK) -nostdlibinc \
57+
-isysroot$(OSX_SDK) -nostdinc \
58+
-isystem$(clang_resource_dir)/include \
5659
-iwithsysroot/usr/include -iframeworkwithsysroot/System/Library/Frameworks
5760

5861
darwin_CXX=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH $(clangxx_prog) --target=$(host) \
59-
-isysroot$(OSX_SDK) -nostdlibinc \
62+
-isysroot$(OSX_SDK) -nostdinc -nostdinc++ \
6063
-iwithsysroot/usr/include/c++/v1 \
64+
-isystem$(clang_resource_dir)/include \
6165
-iwithsysroot/usr/include -iframeworkwithsysroot/System/Library/Frameworks
6266

6367
darwin_CFLAGS=-pipe -std=$(C_STANDARD) -mmacos-version-min=$(OSX_MIN_VERSION)

0 commit comments

Comments
 (0)