Skip to content

Commit aa8138a

Browse files
committed
CMake: Include zippered catalyst slice
Add the flags to include the zippered catalyst slice if a variant target triple is set.
1 parent 4dae976 commit aa8138a

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

Runtimes/Core/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ include(EmitSwiftInterface)
8383
include(PlatformInfo)
8484
include(gyb)
8585
include(ResourceEmbedding)
86+
include(CatalystSupport)
8687

8788
check_symbol_exists("asl_log" "asl.h" SwiftCore_HAS_ASL)
8889
check_symbol_exists("dladdr" "dlfcn.h" SwiftCore_HAS_DLADDR)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Add flags for generating the zippered target variant in the build
2+
3+
if(SwiftCore_COMPILER_VARIANT_TARGET)
4+
add_compile_options(
5+
"$<$<COMPILE_LANGUAGE:C,CXX>:SHELL:-darwin-target-variant ${SwiftCore_COMPILER_VARIANT_TARGET}>"
6+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-target-variant ${SwiftCore_COMPILER_VARIANT_TARGET}>"
7+
8+
# TODO: Remove me once we have a driver with
9+
# https://github.com/swiftlang/swift-driver/pull/1803
10+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xclang-linker -darwin-target-variant -Xclang-linker ${SwiftCore_COMPILER_VARIANT_TARGET}>")
11+
12+
add_link_options(
13+
"$<$<LINK_LANGUAGE:C,CXX>:SHELL:-darwin-target-variant ${SwiftCore_COMPILER_VARIANT_TARGET}>"
14+
"$<$<LINK_LANGUAGE:Swift>:SHELL:-target-variant ${SwiftCore_COMPILER_VARIANT_TARGET}>"
15+
16+
# TODO: Remove me once we have a driver with
17+
# https://github.com/swiftlang/swift-driver/pull/1803
18+
"$<$<LINK_LANGUAGE:Swift>:SHELL:-Xclang-linker -darwin-target-variant -Xclang-linker ${SwiftCore_COMPILER_VARIANT_TARGET}>")
19+
endif()

0 commit comments

Comments
 (0)