Skip to content

Commit 4ab800e

Browse files
authored
CMake: allow to build embedded stdlib in a standalone preset (#70238)
This would be needed to support Apple internal configurations. Addresses rdar://119192035
1 parent d4b1172 commit 4ab800e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

stdlib/public/CMakeLists.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,17 @@ option(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB
138138
"Enable build of the embedded Swift standard library and runtime"
139139
TRUE)
140140

141+
# Temporarily, by default only build embedded stdlib when building the compiler, to
142+
# unblock CI jobs that run against old(er) toolchains.
143+
option(SWIFT_ALLOW_BUILD_EMBEDDED_STDLIB_WITH_HOST_COMPILER
144+
"Build embedded Swift standard library and runtime even
145+
if we are not building our own compiler"
146+
FALSE)
147+
141148
if((NOT SWIFT_HOST_VARIANT STREQUAL "macosx") AND (NOT SWIFT_HOST_VARIANT STREQUAL "linux"))
142149
set(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB FALSE)
143150
elseif(NOT SWIFT_INCLUDE_TOOLS)
144-
# Temporarily, only build embedded stdlib when building the compiler, to
145-
# unblock CI jobs that run against old(er) toolchains.
146-
set(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB FALSE)
151+
set(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB ${SWIFT_ALLOW_BUILD_EMBEDDED_STDLIB_WITH_HOST_COMPILER})
147152
elseif(BOOTSTRAPPING_MODE STREQUAL "OFF")
148153
set(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB FALSE)
149154
endif()

0 commit comments

Comments
 (0)