Skip to content

Commit 2eade1e

Browse files
authored
Merge pull request #76253 from rintaro/cmake-package-cmo-rdar135110846
[CMake] Enable library evolution unconditionally for package CMO
2 parents 92c65f5 + 7a002b2 commit 2eade1e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cmake/modules/AddPureSwift.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,19 @@ function(_set_pure_swift_package_options target_name package_name)
125125
return()
126126
endif()
127127

128-
# Enable package CMO if possible
128+
# Enable package CMO if possible.
129+
# NOTE: '-enable-library-evolution' is required for package CMO even when we
130+
# don't need '.swiftinterface'. E.g. executables.
129131
if(Swift_COMPILER_PACKAGE_CMO_SUPPORT STREQUAL "IMPLEMENTED")
130132
target_compile_options("${target_name}" PRIVATE
133+
"-enable-library-evolution"
131134
"SHELL:-package-name ${package_name}"
132135
"SHELL:-Xfrontend -package-cmo"
133136
"SHELL:-Xfrontend -allow-non-resilient-access"
134137
)
135138
elseif(Swift_COMPILER_PACKAGE_CMO_SUPPORT STREQUAL "EXPERIMENTAL")
136139
target_compile_options("${target_name}" PRIVATE
140+
"-enable-library-evolution"
137141
"SHELL:-package-name ${package_name}"
138142
"SHELL:-Xfrontend -experimental-package-cmo"
139143
"SHELL:-Xfrontend -experimental-allow-non-resilient-access"

0 commit comments

Comments
 (0)