Skip to content

Revert "[CMake] Begin moving Standard Library options in a separate file" #40641

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

Closed
wants to merge 1 commit into from
Closed
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
11 changes: 4 additions & 7 deletions cmake/modules/StandaloneOverlay.cmake
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# In some configurations (e.g. back deploy concurrency) we
# configure the build from the root of the Swift repo but we skip
# stdlib/CMakeLists.txt, with the risk of missing important parameters.
# To account for this scenario, we include the stdlib options
# before the guard
include(${CMAKE_CURRENT_LIST_DIR}/../../stdlib/cmake/modules/StdlibOptions.cmake)

# CMAKE_SOURCE_DIR is the directory that cmake got initially invoked on.
# CMAKE_CURRENT_SOURCE_DIR is the current directory. If these are equal, it's
# a top-level build of the CMAKE_SOURCE_DIR. Otherwise, define a guard variable
Expand Down Expand Up @@ -92,6 +85,10 @@ set(SWIFT_DARWIN_MODULE_ARCHS "" CACHE STRING
targets on Darwin platforms. These targets are in addition to the full \
library targets.")

option(SWIFT_STDLIB_SHORT_MANGLING_LOOKUPS
"Build stdlib with fast-path context descriptor lookups based on well-known short manglings."
TRUE)

# -----------------------------------------------------------------------------
# Constants

Expand Down
21 changes: 12 additions & 9 deletions stdlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,9 @@ endif()
# User-configurable options for the standard library.
#

# New options should be added to stdlib/cmake/modules/StdlibOptions.cmake,
# so that they are considered in configurations using StandaloneOverlay.cmake

# NOTE: Some of these variables are also initialized in StandaloneOverlay.cmake
# so that interfaces are emitted when overlays are separately built.

# TODO: migrate this section to StdlibOptions.cmake to reduce duplication

set(SWIFT_STDLIB_EXTRA_SWIFT_COMPILE_FLAGS "" CACHE STRING
"Extra flags to pass when compiling swift stdlib files")

Expand All @@ -94,6 +89,10 @@ option(SWIFT_ENABLE_MODULE_INTERFACES
"Generate .swiftinterface files alongside .swiftmodule files"
"${SWIFT_STDLIB_STABLE_ABI}")

option(SWIFT_STDLIB_SUPPORT_BACK_DEPLOYMENT
"Support back-deployment of built binaries to older OS versions."
TRUE)

option(SWIFT_STDLIB_HAS_DLADDR
"Build stdlib assuming the runtime environment runtime environment provides dladdr API."
TRUE)
Expand Down Expand Up @@ -134,6 +133,10 @@ option(SWIFT_STDLIB_PASSTHROUGH_METADATA_ALLOCATOR
"Build stdlib without a custom implementation of MetadataAllocator, relying on malloc+free instead."
FALSE)

option(SWIFT_STDLIB_SHORT_MANGLING_LOOKUPS
"Build stdlib with fast-path context descriptor lookups based on well-known short manglings."
TRUE)

option(SWIFT_STDLIB_HAS_COMMANDLINE
"Build stdlib with the CommandLine enum and support for argv/argc."
TRUE)
Expand Down Expand Up @@ -161,6 +164,10 @@ option(SWIFT_ENABLE_REFLECTION
"Build stdlib with support for runtime reflection and mirrors."
TRUE)

option(SWIFT_STDLIB_BUILD_PRIVATE
"Build private part of the Standard Library."
TRUE)

if(SWIFT_STDLIB_SINGLE_THREADED_RUNTIME)
set(SWIFT_CONCURRENCY_GLOBAL_EXECUTOR_default "singlethreaded")
else()
Expand All @@ -171,10 +178,6 @@ set(SWIFT_CONCURRENCY_GLOBAL_EXECUTOR
"${SWIFT_CONCURRENCY_GLOBAL_EXECUTOR_default}" CACHE STRING
"Build the concurrency library to use the given global executor (options: dispatch, singlethreaded, hooked)")

# New options should be added to stdlib/cmake/modules/StdlibOptions.cmake,
# so that they are considered in configurations using StandaloneOverlay.cmake
include(StdlibOptions)

#
# End of user-configurable options.
#
Expand Down
13 changes: 0 additions & 13 deletions stdlib/cmake/modules/StdlibOptions.cmake

This file was deleted.