Skip to content

Commit 581f1b0

Browse files
authored
Merge pull request #5003 from modocache/stdlib-runtime-cmake-target-sdks
[runtime] Update CMake to use TARGET_SDKS (NFC)
2 parents e6f263f + 341d022 commit 581f1b0

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

stdlib/public/runtime/CMakeLists.txt

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,12 @@ endif()
2121
list(APPEND swift_runtime_compile_flags
2222
"-D__SWIFT_CURRENT_DYLIB=swiftCore")
2323

24-
set(swift_runtime_objc_sources)
25-
set(swift_runtime_unicode_normalization_sources)
26-
if(SWIFT_HOST_VARIANT MATCHES "${SWIFT_DARWIN_VARIANTS}")
27-
set(swift_runtime_objc_sources
28-
ErrorObject.mm
29-
SwiftObject.mm
30-
SwiftValue.mm
31-
Remangle.cpp
32-
Reflection.mm)
33-
else()
34-
endif()
24+
set(swift_runtime_objc_sources
25+
ErrorObject.mm
26+
SwiftObject.mm
27+
SwiftValue.mm
28+
Remangle.cpp
29+
Reflection.mm)
3530

3631
set(swift_runtime_sources
3732
AnyHashableSupport.cpp
@@ -68,13 +63,25 @@ set(LLVM_OPTIONAL_SOURCES
6863
${swift_runtime_objc_sources}
6964
${swift_runtime_leaks_sources})
7065

66+
set(swift_runtime_library_compile_flags ${swift_runtime_compile_flags})
67+
list(APPEND swift_runtime_library_compile_flags -DswiftCore_EXPORTS)
68+
7169
add_swift_library(swiftRuntime OBJECT_LIBRARY TARGET_LIBRARY
7270
${swift_runtime_sources}
7371
${swift_runtime_objc_sources}
7472
${swift_runtime_leaks_sources}
75-
C_COMPILE_FLAGS ${swift_runtime_compile_flags} -DswiftCore_EXPORTS
73+
C_COMPILE_FLAGS ${swift_runtime_library_compile_flags}
74+
LINK_FLAGS ${swift_runtime_linker_flags}
75+
INSTALL_IN_COMPONENT never_install
76+
TARGET_SDKS ALL_APPLE_PLATFORMS)
77+
78+
add_swift_library(swiftRuntime OBJECT_LIBRARY TARGET_LIBRARY
79+
${swift_runtime_sources}
80+
${swift_runtime_leaks_sources}
81+
C_COMPILE_FLAGS ${swift_runtime_library_compile_flags}
7682
LINK_FLAGS ${swift_runtime_linker_flags}
77-
INSTALL_IN_COMPONENT never_install)
83+
INSTALL_IN_COMPONENT never_install
84+
TARGET_SDKS ANDROID CYGWIN FREEBSD LINUX)
7885

7986
set(ELFISH_SDKS)
8087
foreach(sdk ${SWIFT_CONFIGURED_SDKS})

0 commit comments

Comments
 (0)