Skip to content

[runtime] Update CMake to use TARGET_SDKS (NFC) #5003

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 20 additions & 13 deletions stdlib/public/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,12 @@ endif()
list(APPEND swift_runtime_compile_flags
"-D__SWIFT_CURRENT_DYLIB=swiftCore")

set(swift_runtime_objc_sources)
set(swift_runtime_unicode_normalization_sources)
if(SWIFT_HOST_VARIANT MATCHES "${SWIFT_DARWIN_VARIANTS}")
set(swift_runtime_objc_sources
ErrorObject.mm
SwiftObject.mm
SwiftValue.mm
Remangle.cpp
Reflection.mm)
else()
endif()
set(swift_runtime_objc_sources
ErrorObject.mm
SwiftObject.mm
SwiftValue.mm
Remangle.cpp
Reflection.mm)

set(swift_runtime_sources
AnyHashableSupport.cpp
Expand Down Expand Up @@ -68,13 +63,25 @@ set(LLVM_OPTIONAL_SOURCES
${swift_runtime_objc_sources}
${swift_runtime_leaks_sources})

set(swift_runtime_library_compile_flags ${swift_runtime_compile_flags})
list(APPEND swift_runtime_library_compile_flags -DswiftCore_EXPORTS)

add_swift_library(swiftRuntime OBJECT_LIBRARY TARGET_LIBRARY
${swift_runtime_sources}
${swift_runtime_objc_sources}
${swift_runtime_leaks_sources}
C_COMPILE_FLAGS ${swift_runtime_compile_flags} -DswiftCore_EXPORTS
C_COMPILE_FLAGS ${swift_runtime_library_compile_flags}
LINK_FLAGS ${swift_runtime_linker_flags}
INSTALL_IN_COMPONENT never_install
TARGET_SDKS ALL_APPLE_PLATFORMS)

add_swift_library(swiftRuntime OBJECT_LIBRARY TARGET_LIBRARY
${swift_runtime_sources}
${swift_runtime_leaks_sources}
C_COMPILE_FLAGS ${swift_runtime_library_compile_flags}
LINK_FLAGS ${swift_runtime_linker_flags}
INSTALL_IN_COMPONENT never_install)
INSTALL_IN_COMPONENT never_install
TARGET_SDKS ANDROID CYGWIN FREEBSD LINUX)

set(ELFISH_SDKS)
foreach(sdk ${SWIFT_CONFIGURED_SDKS})
Expand Down