Skip to content

Commit 51e5202

Browse files
committed
Runtimes: build Observation when running macOS smoketest
Piggyback the addition of a flag to specify the path of the CMakeConfig.h header needed to compile Observation (needed when consuming SwiftCore through the fine module), and the declaration of SwiftShims as a dependency. Addresses rdar://149241712
1 parent ab5fc57 commit 51e5202

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1711,7 +1711,7 @@ if(SWIFT_ENABLE_NEW_RUNTIME_BUILD)
17111711
# To ensure incremental builds work as expected
17121712
BUILD_ALWAYS 1
17131713
CMAKE_ARGS
1714-
-DSwift_ENABLE_RUNTIMES=StringProcessing|Synchronization|Distributed
1714+
-DSwift_ENABLE_RUNTIMES=StringProcessing|Synchronization|Distributed|Observation
17151715
-DBUILD_SHARED_LIBS=YES
17161716
-DCMAKE_Swift_COMPILER_WORKS:BOOLEAN=YES
17171717
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}

Runtimes/Supplemental/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,14 @@ if(SwiftRuntime_ENABLE_differentiation)
9292
CMAKE_ARGS
9393
${COMMON_OPTIONS})
9494
endif()
95+
96+
# Observation
97+
if(SwiftRuntime_ENABLE_observation)
98+
ExternalProject_Add(Observation
99+
PREFIX "Observation"
100+
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Observation"
101+
INSTALL_DIR "${CMAKE_INSTALL_PREFIX}"
102+
INSTALL_COMMAND ""
103+
CMAKE_ARGS
104+
${COMMON_OPTIONS})
105+
endif()

Runtimes/Supplemental/Observation/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,12 @@ set_target_properties(swiftObservation PROPERTIES
9797
# FIXME: We should split out the parts that are needed by the runtime to avoid
9898
# pulling in headers from the compiler.
9999
target_include_directories(swiftObservation PRIVATE
100-
"${${PROJECT_NAME}_SWIFTC_SOURCE_DIR}/include")
100+
"${${PROJECT_NAME}_SWIFTC_SOURCE_DIR}/include"
101+
# For `swift/runtime/CMakeConfig.h`, which should be generated
102+
# by the Core build system.
103+
"${${PROJECT_NAME}_PATH_TO_SWIFT_RUNTIME_HEADERS}")
101104
target_link_libraries(swiftObservation PRIVATE
105+
swiftShims
102106
swiftCore
103107
swift_Concurrency
104108
$<$<PLATFORM_ID:Android>:swiftAndroid>

0 commit comments

Comments
 (0)