Skip to content

Commit d3535a3

Browse files
committed
CMake: fix missing SWIFT_CONCURRENCY_GLOBAL_EXECUTOR value
`SWIFT_CONCURRENCY_GLOBAL_EXECUTOR` is defined in `stdlib/cmake/modules/StdlibOptions.cmake`, which is not included during the first pass of evaluation of the root `CMakeLists.txt`. It is available on subsequent evaluations after the value is stored in CMake cache. This led to subtle bugs, where `usr/lib/swift_static/linux/static-stdlib-args.lnk` didn't contain certain flags on clean toolchain builds, but did contain them in incremental builds. Not having these autolinking flags in toolchain builds leads to errors when statically linking executables on Linux.
1 parent 85f8090 commit d3535a3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ set(SWIFT_HOST_VARIANT_ARCH "${SWIFT_HOST_VARIANT_ARCH_default}" CACHE STRING
163163
# This is primarily to support building smaller or faster project files.
164164
#
165165

166+
# Subsequent options may refer to `StdlibOptions`, which have to be defined first.
167+
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/stdlib/cmake/modules)
168+
include(StdlibOptions)
169+
166170
option(SWIFT_APPEND_VC_REV
167171
"Embed the version control system revision in Swift"
168172
TRUE)

0 commit comments

Comments
 (0)