Skip to content

Commit e6cfd51

Browse files
authored
Merge pull request #28537 from edymtt/skip-clang-tools-extra
[build] allow to skip build of clang-tools-extras
2 parents e28ee0c + e5e2743 commit e6cfd51

File tree

4 files changed

+23
-8
lines changed

4 files changed

+23
-8
lines changed

utils/build-script

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,8 @@ class BuildScriptInvocation(object):
498498
impl_args += ["--skip-build-watchos-simulator"]
499499
if not args.build_android:
500500
impl_args += ["--skip-build-android"]
501+
if not args.build_clang_tools_extra:
502+
impl_args += ["--skip-build-clang-tools-extra"]
501503

502504
if not args.test and not args.long_test and not args.stress_test:
503505
impl_args += ["--skip-test-swift"]

utils/build-script-impl

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ KNOWN_SETTINGS=(
125125
skip-build-benchmarks "" "set to skip building Swift Benchmark Suite"
126126
skip-build-external-benchmarks "1" "set to skip building the external Swift Benchmark Suite. (skipped by default)"
127127
skip-build-playgroundsupport "" "set to skip building PlaygroundSupport"
128+
skip-build-clang-tools-extra "" "set to skip building clang-tools-extra as part of llvm"
128129
skip-local-build "" "set to skip building for the current host (useful when crosscompiling)"
129130
skip-test-cmark "" "set to skip testing CommonMark"
130131
skip-test-lldb "" "set to skip testing lldb"
@@ -1680,16 +1681,20 @@ for host in "${ALL_HOSTS[@]}"; do
16801681
"${llvm_cmake_options[@]}"
16811682
)
16821683

1683-
if [[ "${SKIP_BUILD_COMPILER_RT}" ]]; then
1684-
cmake_options+=(
1685-
-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;"
1686-
)
1687-
else
1688-
cmake_options+=(
1689-
-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;compiler-rt;"
1690-
)
1684+
llvm_enable_projects=("clang")
1685+
1686+
if [[ ! "${SKIP_BUILD_COMPILER_RT}" ]]; then
1687+
llvm_enable_projects+=("compiler-rt")
16911688
fi
16921689

1690+
if [[ ! "${SKIP_BUILD_CLANG_TOOLS_EXTRA}" ]]; then
1691+
llvm_enable_projects+=("clang-tools-extra")
1692+
fi
1693+
1694+
cmake_options+=(
1695+
-DLLVM_ENABLE_PROJECTS="$(join ";" ${llvm_enable_projects[@]})"
1696+
)
1697+
16931698
cmake_options+=(
16941699
-DLLVM_TOOL_LLD_BUILD:BOOL=TRUE
16951700
)

utils/build_swift/driver_arguments.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,11 @@ def create_argument_parser():
615615
option(['--build-libparser-only'], store_true('build_libparser_only'),
616616
help='build only libParser for SwiftSyntax')
617617

618+
option('--skip-build-clang-tools-extra',
619+
toggle_false('build_clang_tools_extra'),
620+
default=True,
621+
help='skip building clang-tools-extra as part of llvm')
622+
618623
# -------------------------------------------------------------------------
619624
in_group('Extra actions to perform before or in addition to building')
620625

utils/build_swift/tests/expected_options.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
'build_android': False,
5757
'build_args': [],
5858
'build_benchmarks': True,
59+
'build_clang_tools_extra': True,
5960
'build_cygwin': True,
6061
'build_external_benchmarks': False,
6162
'build_foundation': False,
@@ -553,6 +554,8 @@ class BuildScriptImplOption(_BaseOption):
553554
DisableOption('--skip-test-swiftevolve', dest='test_swiftevolve'),
554555
DisableOption('--skip-test-toolchain-benchmarks',
555556
dest='test_toolchainbenchmarks'),
557+
DisableOption('--skip-build-clang-tools-extra',
558+
dest='build_clang_tools_extra'),
556559

557560
ChoicesOption('--android-ndk-gcc-version',
558561
choices=['4.8', '4.9']),

0 commit comments

Comments
 (0)