Skip to content

CMake: allow to only build Core and Onone when building the stdlib #69747

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
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions stdlib/cmake/modules/StdlibOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ option(SWIFT_STDLIB_EMIT_API_DESCRIPTORS
"Emit api descriptors for the standard library"
FALSE)

option(SWIFT_STDLIB_BUILD_ONLY_CORE_MODULES
"Build only the core subset of the standard library,
ignoring additional libraries such as Concurrency, Distributed and StringProcessing.
This is an option meant for internal configurations inside Apple
that need to build the standard libraries in chunks when constructing an SDK"
FALSE)

if("${SWIFT_HOST_VARIANT_SDK}" IN_LIST SWIFT_DARWIN_PLATFORMS)
set(SWIFT_STDLIB_ENABLE_PRESPECIALIZATION_default TRUE)
elseif("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "LINUX")
Expand Down
5 changes: 5 additions & 0 deletions stdlib/public/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,12 @@ if(SWIFT_BUILD_STDLIB)
add_subdirectory(stubs)
add_subdirectory(core)
add_subdirectory(SwiftOnoneSupport)
endif()

if(SWIFT_BUILD_STDLIB AND NOT SWIFT_STDLIB_BUILD_ONLY_CORE_MODULES)
# In some internal Apple configurations we have the need
# to build Core and Onone separately from the rest
# of the stdlib
if(SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING)
add_subdirectory(Differentiation)
endif()
Expand Down