Skip to content

[5.0] build-script: teach the script to optionally install swiftsyntax. #20357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions utils/build-presets.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,11 @@ skip-test-llbuild
skip-test-lldb
skip-test-cmark
skip-test-playgroundsupport
skip-test-swiftsyntax

swiftsyntax
install-swiftsyntax
skip-install-swiftsyntax-module

#===------------------------------------------------------------------------===#
# LLDB build configurations
Expand Down
19 changes: 18 additions & 1 deletion utils/build-script-impl
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ KNOWN_SETTINGS=(
install-lldb "" "whether to install LLDB"
install-llbuild "" "whether to install llbuild"
install-swiftpm "" "whether to install swiftpm"
install-swiftsyntax "" "whether to install swiftsyntax"
skip-install-swiftsyntax-module "" "set to skip installing swiftsyntax modules"
install-xctest "" "whether to install xctest"
install-foundation "" "whether to install foundation"
install-libdispatch "" "whether to install libdispatch"
Expand Down Expand Up @@ -3306,7 +3308,22 @@ for host in "${ALL_HOSTS[@]}"; do
continue
;;
swiftsyntax)
# SwiftSyntax is not installed as part of the toolchain
if [[ -z "${INSTALL_SWIFTSYNTAX}" ]] ; then
continue
fi
if [[ -z "${INSTALL_DESTDIR}" ]] ; then
echo "--install-destdir is required to install products."
exit 1
fi
echo "--- Installing ${product} ---"
DYLIB_DIR="${host_install_destdir}${host_install_prefix}/lib/swift/${SWIFT_HOST_VARIANT}"
MODULE_DIR="${DYLIB_DIR}/${SWIFT_HOST_VARIANT_ARCH}"
if [[ -z "${SKIP_INSTALL_SWIFTSYNTAX_MODULE}" ]] ; then
call "${swiftsyntax_build_command[@]}" --dylib-dir="${DYLIB_DIR}" --swiftmodule-dir "${MODULE_DIR}" --install
else
call "${swiftsyntax_build_command[@]}" --dylib-dir="${DYLIB_DIR}" --install
fi

continue
;;
xctest)
Expand Down