Skip to content

Commit e0716a6

Browse files
committed
[build] Fix --skip-build-llvm so that its minimal targets, like tblgen, are still built
Backported from commit c969814, resolves SR-13267
1 parent 865f1bf commit e0716a6

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

utils/build-script-impl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,10 +1141,14 @@ LIBDISPATCH_STATIC_SOURCE_DIR="${WORKSPACE}/swift-corelibs-libdispatch"
11411141
LIBICU_SOURCE_DIR="${WORKSPACE}/icu"
11421142
LIBCXX_SOURCE_DIR="${WORKSPACE}/llvm-project/libcxx"
11431143

1144+
# We cannot currently apply the normal rules of skipping here for LLVM. Even if
1145+
# we are skipping building LLVM, we still need to at least build a few tools
1146+
# like tblgen that Swift relies on for building and testing. See the LLVM
1147+
# configure rules.
1148+
PRODUCTS=(llvm)
11441149
[[ "${SKIP_BUILD_CMARK}" ]] || PRODUCTS+=(cmark)
11451150
[[ "${SKIP_BUILD_LIBCXX}" ]] || PRODUCTS+=(libcxx)
11461151
[[ "${SKIP_BUILD_LIBICU}" ]] || PRODUCTS+=(libicu)
1147-
[[ "${SKIP_BUILD_LLVM}" ]] || PRODUCTS+=(llvm)
11481152
[[ "${SKIP_BUILD_SWIFT}" ]] || PRODUCTS+=(swift)
11491153
[[ "${SKIP_BUILD_LLDB}" ]] || PRODUCTS+=(lldb)
11501154
[[ "${SKIP_BUILD_LIBDISPATCH}" ]] || PRODUCTS+=(libdispatch)
@@ -1534,7 +1538,7 @@ for host in "${ALL_HOSTS[@]}"; do
15341538
if [ "${BUILD_LLVM}" == "0" ] ; then
15351539
build_targets=(clean)
15361540
fi
1537-
if [ "${SKIP_BUILD}" ] ; then
1541+
if [[ "${SKIP_BUILD}" || "${SKIP_BUILD_LLVM}" ]] ; then
15381542
# We can't skip the build completely because the standalone
15391543
# build of Swift depend on these for building and testing.
15401544
build_targets=(llvm-tblgen clang-resource-headers intrinsics_gen clang-tablegen-targets)

validation-test/BuildSystem/skip_cmark_swift_llvm.test-sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# SKIP-CMARK-CHECK: cmake --build {{.*}}swift-
1616

1717
# SKIP-LLVM-CHECK: cmake --build {{.*}}cmark-
18-
# SKIP-LLVM-CHECK-NOT: cmake --build {{.*}}llvm-
18+
# SKIP-LLVM-CHECK: cmake --build {{.*}}llvm-tblgen
1919
# SKIP-LLVM-CHECK: cmake --build {{.*}}swift-
2020

2121
# SKIP-SWIFT-CHECK: cmake --build {{.*}}cmark-

0 commit comments

Comments
 (0)