Skip to content

Commit 15074fb

Browse files
committed
build-script: install swiftsyntax parser into the toolchain
This patch teaches build-script to combine both --build-libparser-only and --install-swift.
1 parent a2896c4 commit 15074fb

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

utils/build-presets.ini

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1900,12 +1900,11 @@ swift-include-tests=0
19001900
darwin-deployment-version-ios=10.0
19011901
darwin-crash-reporter-client=1
19021902

1903-
[preset: build_swiftsyntax_release]
1903+
[preset: install_swiftsyntax_parser]
19041904
release
19051905
lto
19061906
no-assertions
19071907
build-libparser-only
1908-
swiftsyntax
19091908
verbose-build
1910-
skip-swiftsyntax-swiftside
19111909
darwin-install-extract-symbols
1910+
install-swift

utils/build-script-impl

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3502,6 +3502,11 @@ for host in "${ALL_HOSTS[@]}"; do
35023502
if [[ -z "${INSTALL_SWIFT}" ]] ; then
35033503
continue
35043504
fi
3505+
# Swift syntax parser is currently a sub-product of Swift;
3506+
# We need to specify the install target separately here.
3507+
if [ "${BUILD_LIBPARSER_ONLY}" ]; then
3508+
INSTALL_TARGETS=tools/libSwiftSyntaxParser/install
3509+
fi
35053510
;;
35063511
llbuild)
35073512
if [[ -z "${INSTALL_LLBUILD}" ]] ; then
@@ -3807,15 +3812,9 @@ for host in "${ALL_HOSTS[@]}"; do
38073812
call darwin_install_extract_symbols
38083813
else
38093814
set -x
3810-
if [ "${BUILD_LIBPARSER_ONLY}" ]; then
3811-
# We don't have a toolchain so we should install to the specified dir
3812-
CURRENT_INSTALL_DIR="${INSTALL_DESTDIR}"
3813-
CURRENT_PREFIX="/."
3814-
else
3815-
# If we have a toolchain, use the toolchain install dir.
3816-
CURRENT_INSTALL_DIR=${host_install_destdir}
3817-
CURRENT_PREFIX="${TOOLCHAIN_PREFIX}"
3818-
fi
3815+
3816+
CURRENT_INSTALL_DIR=${host_install_destdir}
3817+
CURRENT_PREFIX="${TOOLCHAIN_PREFIX}"
38193818

38203819
# Copy executables and shared libraries from the `host_install_destdir` to
38213820
# INSTALL_SYMROOT and run dsymutil on them.

0 commit comments

Comments
 (0)