Skip to content

Commit 15fb74b

Browse files
committed
Support watchOS and tvOS in compiler-rt builds
Hopefully autotools will be deprecated soon and this entire file can go away, but until then... llvm-svn: 251712
1 parent 7a73cc7 commit 15fb74b

File tree

1 file changed

+36
-3
lines changed

1 file changed

+36
-3
lines changed

clang/runtime/compiler-rt/Makefile

+36-3
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,25 @@ RuntimeLibrary.darwin.Configs := \
8383

8484
IOS_SDK := $(shell xcrun --show-sdk-path -sdk iphoneos 2> /dev/null)
8585
IOSSIM_SDK := $(shell xcrun --show-sdk-path -sdk iphonesimulator 2> /dev/null)
86+
TVOS_SDK := $(shell xcrun --show-sdk-path -sdk appletvos 2> /dev/null)
87+
TVOSSIM_SDK := $(shell xcrun --show-sdk-path -sdk appletvsimulator 2> /dev/null)
88+
WATCHOS_SDK := $(shell xcrun --show-sdk-path -sdk watchos 2> /dev/null)
89+
WATCHOSSIM_SDK := $(shell xcrun --show-sdk-path -sdk watchsimulator 2> /dev/null)
90+
91+
LinkerSupportedArches = \
92+
$(shell \
93+
result=""; \
94+
for arch in $1; do \
95+
if $(LD) -v 2>&1 | grep "configured to support" | tr ' ' '\n' | grep "^$$arch$$" >/dev/null 2>/dev/null; then \
96+
result="$$result$$arch "; \
97+
fi; \
98+
done; \
99+
echo $$result)
100+
101+
102+
RuntimeLibrary.macho_embedded.Configs := \
103+
hard_static.a hard_pic.a
104+
ifneq (,$(findstring ARM,$(TARGETS_TO_BUILD)))
86105

87106
ifneq ($(IOS_SDK)$(IOSSIM_SDK),)
88107
RuntimeLibrary.darwin.Configs += ios.a profile_ios.a
@@ -99,9 +118,23 @@ RuntimeLibrary.darwin.Configs += asan_iossim_dynamic.dylib \
99118
ubsan_iossim_dynamic.dylib
100119
endif
101120

102-
RuntimeLibrary.macho_embedded.Configs := \
103-
hard_static.a hard_pic.a
104-
ifneq (,$(findstring ARM,$(TARGETS_TO_BUILD)))
121+
122+
ifneq ($(TVOS_SDK)$(TVOSSIM_SDK),)
123+
RuntimeLibrary.darwin.Configs += tvos.a profile_tvos.a
124+
endif
125+
126+
ifneq ($(TVOS_SDK),)
127+
RuntimeLibrary.darwin.Configs += cc_kext_tvos.a
128+
endif
129+
130+
ifneq ($(WATCHOS_SDK)$(WATCHOSSIM_SDK),)
131+
RuntimeLibrary.darwin.Configs += watchos.a profile_watchos.a
132+
endif
133+
134+
ifneq ($(WATCHOS_SDK),)
135+
RuntimeLibrary.darwin.Configs += cc_kext_watchos.a
136+
endif
137+
105138
RuntimeLibrary.macho_embedded.Configs += \
106139
soft_static.a soft_pic.a
107140
endif

0 commit comments

Comments
 (0)