Skip to content

Commit 5897ab5

Browse files
authored
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 af933b0 commit 5897ab5

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
@@ -202,6 +202,10 @@ set(SWIFT_HOST_VARIANT_ARCH "${SWIFT_HOST_VARIANT_ARCH_default}" CACHE STRING
202202
# This is primarily to support building smaller or faster project files.
203203
#
204204

205+
# Subsequent options may refer to `StdlibOptions`, which have to be defined first.
206+
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/stdlib/cmake/modules)
207+
include(StdlibOptions)
208+
205209
option(SWIFT_APPEND_VC_REV
206210
"Embed the version control system revision in Swift"
207211
TRUE)

0 commit comments

Comments
 (0)