Skip to content

Commit

Permalink
CMake: fix missing SWIFT_CONCURRENCY_GLOBAL_EXECUTOR value
Browse files Browse the repository at this point in the history
`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.
  • Loading branch information
MaxDesiatov authored May 9, 2023
1 parent af933b0 commit 5897ab5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ set(SWIFT_HOST_VARIANT_ARCH "${SWIFT_HOST_VARIANT_ARCH_default}" CACHE STRING
# This is primarily to support building smaller or faster project files.
#

# Subsequent options may refer to `StdlibOptions`, which have to be defined first.
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/stdlib/cmake/modules)
include(StdlibOptions)

option(SWIFT_APPEND_VC_REV
"Embed the version control system revision in Swift"
TRUE)
Expand Down

0 comments on commit 5897ab5

Please sign in to comment.