Skip to content

macOS smoketest: enable Distributed and Synchronization in runtimes #83604

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
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1711,7 +1711,7 @@ if(SWIFT_ENABLE_NEW_RUNTIME_BUILD)
# To ensure incremental builds work as expected
BUILD_ALWAYS 1
CMAKE_ARGS
-DSwift_ENABLE_RUNTIMES=StringProcessing
-DSwift_ENABLE_RUNTIMES=StringProcessing|Synchronization|Distributed
-DBUILD_SHARED_LIBS=YES
-DCMAKE_Swift_COMPILER_WORKS:BOOLEAN=YES
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
Expand Down
4 changes: 3 additions & 1 deletion Runtimes/Core/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,9 @@ target_link_libraries(swiftCore
swiftThreading
$<$<NOT:$<PLATFORM_ID:Darwin>>:swiftrt$<$<PLATFORM_ID:Windows>:T>>
PUBLIC
swiftShims)
swiftShims
INTERFACE
swiftRuntimeCMakeConfig)

string(TOLOWER "${SwiftCore_OBJECT_FORMAT}" SwiftCore_OBJECT_FORMAT_lc)
if("${SwiftCore_OBJECT_FORMAT_lc}" STREQUAL "elf")
Expand Down
12 changes: 12 additions & 0 deletions Runtimes/Core/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ configure_file("CMakeConfig.h.in"
"${PROJECT_BINARY_DIR}/include/swift/Runtime/CMakeConfig.h"
ESCAPE_QUOTES @ONLY)

add_library(swiftRuntimeCMakeConfig INTERFACE)
target_include_directories(swiftRuntimeCMakeConfig INTERFACE
$<$<COMPILE_LANGUAGE:C,CXX,Swift>:$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>>)

add_library(swiftRuntime OBJECT
"${PROJECT_SOURCE_DIR}/CompatibilityOverride/CompatibilityOverride.cpp"
AnyHashableSupport.cpp
Expand Down Expand Up @@ -132,6 +136,14 @@ if(SwiftCore_ENABLE_OBJC_INTEROP)
ObjCRuntimeGetImageNameFromClass.mm)
endif()

install(FILES
"${PROJECT_BINARY_DIR}/include/swift/Runtime/CMakeConfig.h"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/swift/Runtime"
COMPONENT SwiftCore_development)
install(TARGETS swiftRuntimeCMakeConfig
EXPORT SwiftCoreTargets
COMPONENT SwiftCore_development)

if(NOT BUILD_SHARED_LIBS)
install(TARGETS swiftRuntime
EXPORT SwiftCoreTargets
Expand Down
4 changes: 2 additions & 2 deletions Runtimes/Supplemental/Distributed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ target_link_libraries(swiftDistributed PRIVATE
swift_Concurrency
swift_Builtin_float
$<$<PLATFORM_ID:Android>:swiftAndroid>
$<$<PLATFORM_ID:Windows>:swiftWinSDK>)
# swiftDarwin/Libc/Platform
$<$<PLATFORM_ID:Windows>:swiftWinSDK>
$<$<PLATFORM_ID:Darwin>:swiftDarwin>)

install(TARGETS swiftDistributed
EXPORT SwiftDistributedTargets
Expand Down
11 changes: 9 additions & 2 deletions Runtimes/Supplemental/cmake/modules/FindSwiftCore.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,15 @@ endif()
find_path(SwiftShims_INCLUDE_DIR "shims/module.modulemap" HINTS
${SwiftShims_INCLUDE_DIR_HINTS})
add_library(swiftShims INTERFACE IMPORTED GLOBAL)
set_target_properties(swiftShims PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${SwiftShims_INCLUDE_DIR}/shims")
target_include_directories(swiftShims INTERFACE
# This is needed for targets that import headers from
# include/swift (e.g. include/swift/ABI/HeapObject.h)
# that assumes the shims are located in `swift/shims`
# relative path
"${SwiftShims_INCLUDE_DIR}/.."
"${SwiftShims_INCLUDE_DIR}/shims")
target_compile_options(swiftShims INTERFACE
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xcc -fmodule-map-file=\"${SwiftShims_INCLUDE_DIR}/shims/module.modulemap\">")

find_package_handle_standard_args(SwiftCore DEFAULT_MSG
SwiftCore_LIBRARY SwiftCore_INCLUDE_DIR
Expand Down