Skip to content

Commit 02a5873

Browse files
committed
Remove -enable-ossa-module for Synchronization and Distributed
These modules import Darwin which is not in ossa. -enable-ossa-modules results in a one-time recompilation of dependencies when they are not in ossa. This is not compatible with Explicit Build Modules when the original invocation did not have -enable-ossa-modules.
1 parent bfd3584 commit 02a5873

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

stdlib/cmake/modules/AddSwiftStdlib.cmake

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1836,6 +1836,9 @@ endfunction()
18361836
# INSTALL_WITH_SHARED
18371837
# Install a static library target alongside shared libraries
18381838
#
1839+
# IMPORTS_NON_OSSA
1840+
# Imports a non-ossa module
1841+
#
18391842
# MACCATALYST_BUILD_FLAVOR
18401843
# Possible values are 'ios-like', 'macos-like', 'zippered', 'unzippered-twin'
18411844
# Presence of a build flavor requires SWIFT_MODULE_DEPENDS_MACCATALYST to be
@@ -1895,7 +1898,8 @@ function(add_swift_target_library name)
18951898
SHARED
18961899
STATIC
18971900
NO_LINK_NAME
1898-
INSTALL_WITH_SHARED)
1901+
INSTALL_WITH_SHARED
1902+
IMPORTS_NON_OSSA)
18991903
set(SWIFTLIB_single_parameter_options
19001904
DEPLOYMENT_VERSION_IOS
19011905
DEPLOYMENT_VERSION_OSX
@@ -2057,10 +2061,13 @@ function(add_swift_target_library name)
20572061
# behavior for their requirements.
20582062
if (SWIFTLIB_IS_STDLIB)
20592063
list(APPEND SWIFTLIB_SWIFT_COMPILE_FLAGS "-warn-implicit-overrides")
2060-
list(APPEND SWIFTLIB_SWIFT_COMPILE_FLAGS "-Xfrontend;-enable-ossa-modules")
20612064
list(APPEND SWIFTLIB_SWIFT_COMPILE_FLAGS "-Xfrontend;-enable-lexical-lifetimes=false")
20622065
endif()
20632066

2067+
if (NOT DEFINED IMPORTS_NON_OSSA)
2068+
list(APPEND SWIFTLIB_SWIFT_COMPILE_FLAGS "-Xfrontend;-enable-ossa-modules")
2069+
endif()
2070+
20642071
if(NOT DEFINED SWIFTLIB_INSTALL_BINARY_SWIFTMODULE)
20652072
set(SWIFTLIB_INSTALL_BINARY_SWIFTMODULE TRUE)
20662073
endif()

stdlib/public/Distributed/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ set(swift_distributed_link_libraries
2020
swiftCore)
2121

2222

23-
add_swift_target_library(swiftDistributed ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
23+
add_swift_target_library(swiftDistributed ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB IMPORTS_NON_OSSA
2424
DistributedActor.cpp
2525
DistributedActor.swift
2626
DistributedActorSystem.swift

stdlib/public/Synchronization/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ set(SWIFT_SYNCHRNOIZATION_SWIFT_FLAGS
7676
"-enable-experimental-feature" "Extern"
7777
)
7878

79-
add_swift_target_library(swiftSynchronization ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
79+
add_swift_target_library(swiftSynchronization ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB IMPORTS_NON_OSSA
8080
${SWIFT_SYNCHRONIZATION_SOURCES}
8181

8282
GYB_SOURCES

0 commit comments

Comments
 (0)