diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f6d0fd9596..9eb5c044bf9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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|Synchronization|Distributed + -DSwift_ENABLE_RUNTIMES=StringProcessing|Synchronization|Distributed|Observation -DBUILD_SHARED_LIBS=YES -DCMAKE_Swift_COMPILER_WORKS:BOOLEAN=YES -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} diff --git a/Runtimes/Supplemental/CMakeLists.txt b/Runtimes/Supplemental/CMakeLists.txt index bf604285224..977a178d9a9 100644 --- a/Runtimes/Supplemental/CMakeLists.txt +++ b/Runtimes/Supplemental/CMakeLists.txt @@ -92,3 +92,14 @@ if(SwiftRuntime_ENABLE_differentiation) CMAKE_ARGS ${COMMON_OPTIONS}) endif() + +# Observation +if(SwiftRuntime_ENABLE_observation) + ExternalProject_Add(Observation + PREFIX "Observation" + SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Observation" + INSTALL_DIR "${CMAKE_INSTALL_PREFIX}" + INSTALL_COMMAND "" + CMAKE_ARGS + ${COMMON_OPTIONS}) +endif() diff --git a/Runtimes/Supplemental/Observation/CMakeLists.txt b/Runtimes/Supplemental/Observation/CMakeLists.txt index 2996cc3efc9..8d16dcd95eb 100644 --- a/Runtimes/Supplemental/Observation/CMakeLists.txt +++ b/Runtimes/Supplemental/Observation/CMakeLists.txt @@ -97,8 +97,12 @@ set_target_properties(swiftObservation PROPERTIES # FIXME: We should split out the parts that are needed by the runtime to avoid # pulling in headers from the compiler. target_include_directories(swiftObservation PRIVATE - "${${PROJECT_NAME}_SWIFTC_SOURCE_DIR}/include") + "${${PROJECT_NAME}_SWIFTC_SOURCE_DIR}/include" + # For `swift/runtime/CMakeConfig.h`, which should be generated + # by the Core build system. + "${${PROJECT_NAME}_PATH_TO_SWIFT_RUNTIME_HEADERS}") target_link_libraries(swiftObservation PRIVATE + swiftShims swiftCore swift_Concurrency $<$:swiftAndroid>