Skip to content

CMake: allow to build embedded stdlib in a standalone preset #70238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions stdlib/public/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,17 @@ option(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB
"Enable build of the embedded Swift standard library and runtime"
TRUE)

# Temporarily, by default only build embedded stdlib when building the compiler, to
# unblock CI jobs that run against old(er) toolchains.
option(SWIFT_ALLOW_BUILD_EMBEDDED_STDLIB_WITH_HOST_COMPILER
"Build embedded Swift standard library and runtime even
if we are not building our own compiler"
FALSE)

if((NOT SWIFT_HOST_VARIANT STREQUAL "macosx") AND (NOT SWIFT_HOST_VARIANT STREQUAL "linux"))
set(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB FALSE)
elseif(NOT SWIFT_INCLUDE_TOOLS)
# Temporarily, only build embedded stdlib when building the compiler, to
# unblock CI jobs that run against old(er) toolchains.
set(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB FALSE)
set(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB ${SWIFT_ALLOW_BUILD_EMBEDDED_STDLIB_WITH_HOST_COMPILER})
elseif(BOOTSTRAPPING_MODE STREQUAL "OFF")
set(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB FALSE)
endif()
Expand Down