Skip to content

Commit 94794d0

Browse files
committed
Only build iOS runtime libraries when the iOS SDKs are available.
This was already set up for the iOS simulator ASan dylib simulator, and this change extends that to the other iOS runtime libraries. This is in preparation for building all those iOS libraries against the real SDKs instead of the fake SDKs in compiler-rt. llvm-svn: 221614
1 parent ccde2a9 commit 94794d0

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

clang/runtime/compiler-rt/Makefile

+17-6
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,26 @@ RuntimeDirs :=
8080
ifeq ($(OS),Darwin)
8181
RuntimeDirs += darwin macho_embedded
8282
RuntimeLibrary.darwin.Configs := \
83-
eprintf.a 10.4.a osx.a ios.a cc_kext.a cc_kext_ios5.a \
83+
eprintf.a 10.4.a osx.a cc_kext.a \
8484
asan_osx_dynamic.dylib \
85-
profile_osx.a profile_ios.a \
85+
profile_osx.a \
8686
ubsan_osx.a
8787

88+
IOS_SDK := $(shell xcrun --show-sdk-path -sdk iphoneos 2> /dev/null)
89+
IOSSIM_SDK := $(shell xcrun --show-sdk-path -sdk iphonesimulator 2> /dev/null)
90+
91+
ifneq ($(IOS_SDK)$(IOSSIM_SDK),)
92+
RuntimeLibrary.darwin.Configs += ios.a profile_ios.a
93+
endif
94+
95+
ifneq ($(IOS_SDK),)
96+
RuntimeLibrary.darwin.Configs += cc_kext_ios5.a
97+
endif
98+
99+
ifneq ($(IOSSIM_SDK),)
100+
RuntimeLibrary.darwin.Configs += asan_iossim_dynamic.dylib
101+
endif
102+
88103
RuntimeLibrary.macho_embedded.Configs := \
89104
hard_static.a hard_pic.a
90105
ifneq (,$(findstring ARM,$(TARGETS_TO_BUILD)))
@@ -101,10 +116,6 @@ ACTIVE_SDK_PATH := $(shell xcrun --show-sdk-path 2> /dev/null)
101116
ifneq ($(ACTIVE_SDK_PATH),)
102117
COMPILERRT_MAKE_FLAGS := SDKROOT=$(ACTIVE_SDK_PATH)
103118
endif
104-
IOSSIM_SDK_PATH := $(shell xcrun --show-sdk-path -sdk iphonesimulator 2> /dev/null)
105-
ifneq ($(IOSSIM_SDK_PATH),)
106-
RuntimeLibrary.darwin.Configs += asan_iossim_dynamic.dylib
107-
endif
108119

109120
endif
110121

0 commit comments

Comments
 (0)