Skip to content

Commit 0bea666

Browse files
authored
Merge pull request #20357 from nkcsgexi/cherry-pick-build-script
[5.0] build-script: teach the script to optionally install swiftsyntax.
2 parents aa74aa6 + 3a8cde2 commit 0bea666

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

utils/build-presets.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,11 @@ skip-test-llbuild
11071107
skip-test-lldb
11081108
skip-test-cmark
11091109
skip-test-playgroundsupport
1110+
skip-test-swiftsyntax
11101111

1112+
swiftsyntax
1113+
install-swiftsyntax
1114+
skip-install-swiftsyntax-module
11111115

11121116
#===------------------------------------------------------------------------===#
11131117
# LLDB build configurations

utils/build-script-impl

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ KNOWN_SETTINGS=(
191191
install-lldb "" "whether to install LLDB"
192192
install-llbuild "" "whether to install llbuild"
193193
install-swiftpm "" "whether to install swiftpm"
194+
install-swiftsyntax "" "whether to install swiftsyntax"
195+
skip-install-swiftsyntax-module "" "set to skip installing swiftsyntax modules"
194196
install-xctest "" "whether to install xctest"
195197
install-foundation "" "whether to install foundation"
196198
install-libdispatch "" "whether to install libdispatch"
@@ -3306,7 +3308,22 @@ for host in "${ALL_HOSTS[@]}"; do
33063308
continue
33073309
;;
33083310
swiftsyntax)
3309-
# SwiftSyntax is not installed as part of the toolchain
3311+
if [[ -z "${INSTALL_SWIFTSYNTAX}" ]] ; then
3312+
continue
3313+
fi
3314+
if [[ -z "${INSTALL_DESTDIR}" ]] ; then
3315+
echo "--install-destdir is required to install products."
3316+
exit 1
3317+
fi
3318+
echo "--- Installing ${product} ---"
3319+
DYLIB_DIR="${host_install_destdir}${host_install_prefix}/lib/swift/${SWIFT_HOST_VARIANT}"
3320+
MODULE_DIR="${DYLIB_DIR}/${SWIFT_HOST_VARIANT_ARCH}"
3321+
if [[ -z "${SKIP_INSTALL_SWIFTSYNTAX_MODULE}" ]] ; then
3322+
call "${swiftsyntax_build_command[@]}" --dylib-dir="${DYLIB_DIR}" --swiftmodule-dir "${MODULE_DIR}" --install
3323+
else
3324+
call "${swiftsyntax_build_command[@]}" --dylib-dir="${DYLIB_DIR}" --install
3325+
fi
3326+
33103327
continue
33113328
;;
33123329
xctest)

0 commit comments

Comments
 (0)