Skip to content

Commit 993347d

Browse files
authored
Merge pull request #23176 from gottesmm/pr-ab2244e640285dbd76ecd7672e5cfe8338125021
[cmake] Do not generate the sib targets by default
2 parents 87604fe + cfbb97a commit 993347d

File tree

2 files changed

+56
-43
lines changed

2 files changed

+56
-43
lines changed

CMakeLists.txt

Lines changed: 51 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -101,25 +101,6 @@ if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
101101
message(STATUS "No build type was specified, will default to ${CMAKE_BUILD_TYPE}")
102102
endif()
103103

104-
set(SWIFT_STDLIB_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING
105-
"Build type for the Swift standard library and SDK overlays [Debug, RelWithDebInfo, Release, MinSizeRel]")
106-
set_property(CACHE SWIFT_STDLIB_BUILD_TYPE PROPERTY
107-
STRINGS "Debug" "RelWithDebInfo" "Release" "MinSizeRel")
108-
109-
is_build_type_optimized("${SWIFT_STDLIB_BUILD_TYPE}" swift_optimized)
110-
if(swift_optimized)
111-
set(SWIFT_STDLIB_ASSERTIONS_default FALSE)
112-
else()
113-
set(SWIFT_STDLIB_ASSERTIONS_default TRUE)
114-
endif()
115-
option(SWIFT_STDLIB_ASSERTIONS
116-
"Enable internal checks for the Swift standard library (useful for debugging the library itself, does not affect checks required for safety)"
117-
"${SWIFT_STDLIB_ASSERTIONS_default}")
118-
119-
option(SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER
120-
"Use the host compiler and not the internal clang to build the swift runtime"
121-
FALSE)
122-
123104
set(SWIFT_ANALYZE_CODE_COVERAGE FALSE CACHE STRING
124105
"Build Swift with code coverage instrumenting enabled [FALSE, NOT-MERGED, MERGED]")
125106
set_property(CACHE SWIFT_ANALYZE_CODE_COVERAGE PROPERTY
@@ -146,23 +127,6 @@ set(SWIFT_ENABLE_LLD_LINKER TRUE CACHE BOOL
146127
set(SWIFT_ENABLE_GOLD_LINKER TRUE CACHE BOOL
147128
"Enable using the gold linker when available")
148129

149-
set(SWIFT_SDKS "" CACHE STRING
150-
"If non-empty, limits building target binaries only to specified SDKs (despite other SDKs being available)")
151-
152-
set(SWIFT_PRIMARY_VARIANT_SDK "" CACHE STRING
153-
"Primary SDK for target binaries")
154-
set(SWIFT_PRIMARY_VARIANT_ARCH "" CACHE STRING
155-
"Primary arch for target binaries")
156-
157-
set(SWIFT_NATIVE_LLVM_TOOLS_PATH "" CACHE STRING
158-
"Path to the directory that contains LLVM tools that are executable on the build machine")
159-
160-
set(SWIFT_NATIVE_CLANG_TOOLS_PATH "" CACHE STRING
161-
"Path to the directory that contains Clang tools that are executable on the build machine")
162-
163-
set(SWIFT_NATIVE_SWIFT_TOOLS_PATH "" CACHE STRING
164-
"Path to the directory that contains Swift tools that are executable on the build machine")
165-
166130
set(SWIFT_TOOLS_ENABLE_LTO OFF CACHE STRING "Build Swift tools with LTO. One
167131
must specify the form of LTO by setting this to one of: 'full', 'thin'. This
168132
option only affects the tools that run on the host (the compiler), and has
@@ -176,10 +140,6 @@ option(SWIFT_FORCE_OPTIMIZED_TYPECHECKER "Override the optimization setting of
176140
the type checker so that it always compiles with optimization. This eases
177141
debugging after type checking occurs by speeding up type checking" FALSE)
178142

179-
option(SWIFT_ENABLE_PARSEABLE_MODULE_INTERFACES
180-
"Generate .swiftinterface files alongside .swiftmodule files"
181-
TRUE)
182-
183143
# Allow building Swift with Clang's Profile Guided Optimization
184144
if(SWIFT_PROFDATA_FILE AND EXISTS ${SWIFT_PROFDATA_FILE})
185145
if(NOT CMAKE_C_COMPILER_ID MATCHES Clang)
@@ -188,6 +148,57 @@ if(SWIFT_PROFDATA_FILE AND EXISTS ${SWIFT_PROFDATA_FILE})
188148
add_definitions("-fprofile-instr-use=${SWIFT_PROFDATA_FILE}")
189149
endif()
190150

151+
#
152+
# User-configurable Swift Standard Library specific options.
153+
#
154+
# TODO: Once the stdlib/compiler builds are split, this should be sunk into the
155+
# stdlib cmake.
156+
#
157+
158+
set(SWIFT_STDLIB_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING
159+
"Build type for the Swift standard library and SDK overlays [Debug, RelWithDebInfo, Release, MinSizeRel]")
160+
set_property(CACHE SWIFT_STDLIB_BUILD_TYPE PROPERTY
161+
STRINGS "Debug" "RelWithDebInfo" "Release" "MinSizeRel")
162+
163+
is_build_type_optimized("${SWIFT_STDLIB_BUILD_TYPE}" swift_optimized)
164+
if(swift_optimized)
165+
set(SWIFT_STDLIB_ASSERTIONS_default FALSE)
166+
else()
167+
set(SWIFT_STDLIB_ASSERTIONS_default TRUE)
168+
endif()
169+
option(SWIFT_STDLIB_ASSERTIONS
170+
"Enable internal checks for the Swift standard library (useful for debugging the library itself, does not affect checks required for safety)"
171+
"${SWIFT_STDLIB_ASSERTIONS_default}")
172+
173+
option(SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER
174+
"Use the host compiler and not the internal clang to build the swift runtime"
175+
FALSE)
176+
177+
set(SWIFT_SDKS "" CACHE STRING
178+
"If non-empty, limits building target binaries only to specified SDKs (despite other SDKs being available)")
179+
180+
set(SWIFT_PRIMARY_VARIANT_SDK "" CACHE STRING
181+
"Primary SDK for target binaries")
182+
set(SWIFT_PRIMARY_VARIANT_ARCH "" CACHE STRING
183+
"Primary arch for target binaries")
184+
185+
set(SWIFT_NATIVE_LLVM_TOOLS_PATH "" CACHE STRING
186+
"Path to the directory that contains LLVM tools that are executable on the build machine")
187+
188+
set(SWIFT_NATIVE_CLANG_TOOLS_PATH "" CACHE STRING
189+
"Path to the directory that contains Clang tools that are executable on the build machine")
190+
191+
set(SWIFT_NATIVE_SWIFT_TOOLS_PATH "" CACHE STRING
192+
"Path to the directory that contains Swift tools that are executable on the build machine")
193+
194+
option(SWIFT_ENABLE_PARSEABLE_MODULE_INTERFACES
195+
"Generate .swiftinterface files alongside .swiftmodule files"
196+
TRUE)
197+
198+
option(SWIFT_STDLIB_ENABLE_SIB_TARGETS
199+
"Should we generate sib targets for the stdlib or not?"
200+
FALSE)
201+
191202
#
192203
# User-configurable Android specific options.
193204
#

stdlib/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,11 @@ function(swift_create_stdlib_targets name variant define_all_alias)
102102
endfunction()
103103

104104
swift_create_stdlib_targets("swift-stdlib" "" TRUE)
105-
swift_create_stdlib_targets("swift-stdlib" "sib" TRUE)
106-
swift_create_stdlib_targets("swift-stdlib" "sibopt" TRUE)
107-
swift_create_stdlib_targets("swift-stdlib" "sibgen" TRUE)
105+
if(SWIFT_STDLIB_ENABLE_SIB_TARGETS)
106+
swift_create_stdlib_targets("swift-stdlib" "sib" TRUE)
107+
swift_create_stdlib_targets("swift-stdlib" "sibopt" TRUE)
108+
swift_create_stdlib_targets("swift-stdlib" "sibgen" TRUE)
109+
endif()
108110
swift_create_stdlib_targets("swift-test-stdlib" "" FALSE)
109111

110112
foreach(sdk ${SWIFT_SDKS})

0 commit comments

Comments
 (0)