Skip to content

Commit d685728

Browse files
authored
Merge pull request #21886 from benlangmuir/install-components-default
Set a reasonable default for SWIFT_INSTALL_COMPONENTS
2 parents 230bee4 + aac6046 commit d685728

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

cmake/modules/SwiftComponents.cmake

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,25 @@
6767
set(_SWIFT_DEFINED_COMPONENTS
6868
"autolink-driver;compiler;clang-builtin-headers;clang-resource-dir-symlink;clang-builtin-headers-in-clang-resource-dir;stdlib;stdlib-experimental;sdk-overlay;parser-lib;editor-integration;tools;testsuite-tools;toolchain-dev-tools;dev;license;sourcekit-xpc-service;sourcekit-inproc;swift-remote-mirror;swift-remote-mirror-headers")
6969

70+
# The default install components include all of the defined components, except
71+
# for the following exceptions.
72+
set(_SWIFT_DEFAULT_COMPONENTS "${_SWIFT_DEFINED_COMPONENTS}")
73+
# 'dev' takes up a lot of disk space and isn't part of a normal toolchain.
74+
list(REMOVE_ITEM _SWIFT_DEFAULT_COMPONENTS "dev")
75+
# These clang header options conflict with 'clang-builtin-headers'.
76+
list(REMOVE_ITEM _SWIFT_DEFAULT_COMPONENTS "clang-resource-dir-symlink")
77+
list(REMOVE_ITEM _SWIFT_DEFAULT_COMPONENTS "clang-builtin-headers-in-clang-resource-dir")
78+
# The sourcekit install variants are currently mutually exclusive.
79+
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
80+
list(REMOVE_ITEM _SWIFT_DEFAULT_COMPONENTS "sourcekit-inproc")
81+
else()
82+
list(REMOVE_ITEM _SWIFT_DEFAULT_COMPONENTS "sourcekit-xpc-service")
83+
endif()
84+
7085
macro(swift_configure_components)
7186
# Set the SWIFT_INSTALL_COMPONENTS variable to the default value if it is not passed in via -D
72-
set(SWIFT_INSTALL_COMPONENTS "${_SWIFT_DEFINED_COMPONENTS}" CACHE STRING
73-
"A semicolon-separated list of components to install ${_SWIFT_DEFINED_COMPONENTS}")
87+
set(SWIFT_INSTALL_COMPONENTS "${_SWIFT_DEFAULT_COMPONENTS}" CACHE STRING
88+
"A semicolon-separated list of components to install from the set ${_SWIFT_DEFINED_COMPONENTS}")
7489

7590
foreach(component ${_SWIFT_DEFINED_COMPONENTS})
7691
string(TOUPPER "${component}" var_name_piece)

utils/build-script-impl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2292,7 +2292,6 @@ for host in "${ALL_HOSTS[@]}"; do
22922292
-DSWIFT_BUILD_EXTERNAL_PERF_TESTSUITE:BOOL=$(true_false "${build_external_perf_testsuite_this_time}")
22932293
-DSWIFT_BUILD_EXAMPLES:BOOL=$(true_false "${BUILD_SWIFT_EXAMPLES}")
22942294
-DSWIFT_INCLUDE_TESTS:BOOL=$(true_false "${build_tests_this_time}")
2295-
-DSWIFT_INSTALL_COMPONENTS:STRING="${SWIFT_INSTALL_COMPONENTS}"
22962295
-DSWIFT_EMBED_BITCODE_SECTION:BOOL=$(true_false "${EMBED_BITCODE_SECTION}")
22972296
-DSWIFT_TOOLS_ENABLE_LTO:STRING="${SWIFT_TOOLS_ENABLE_LTO}"
22982297
-DSWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER:BOOL=$(true_false "${BUILD_RUNTIME_WITH_HOST_COMPILER}")
@@ -2363,6 +2362,13 @@ for host in "${ALL_HOSTS[@]}"; do
23632362
)
23642363
fi
23652364

2365+
if [ "${SWIFT_INSTALL_COMPONENTS}" ] ; then
2366+
cmake_options=(
2367+
"${cmake_options[@]}"
2368+
-DSWIFT_INSTALL_COMPONENTS:STRING="${SWIFT_INSTALL_COMPONENTS}"
2369+
)
2370+
fi
2371+
23662372
if contains_product "lldb" ; then
23672373
lldb_build_dir=$(build_directory ${host} lldb)
23682374
cmake_options=(

0 commit comments

Comments
 (0)