Skip to content

Reduce duplication in toolchain argument parsing #39207

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
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
19 changes: 7 additions & 12 deletions utils/build-toolchain
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,17 @@ DRY_RUN=
BUNDLE_PREFIX=
PRESET_FILE_FLAGS=
PRESET_PREFIX=
PRESET_SUFFIX=
NO_TEST=",no_test"
USE_OS_RUNTIME=

case $(uname -s) in
Darwin)
SWIFT_PACKAGE=buildbot_osx_package,no_test
SWIFT_PACKAGE=buildbot_osx_package
OS_SUFFIX=osx
BUILD_SUBDIR=buildbot_osx
;;
Linux)
SWIFT_PACKAGE=buildbot_linux,no_test
SWIFT_PACKAGE=buildbot_linux
OS_SUFFIX=linux
BUILD_SUBDIR=buildbot_linux
;;
Expand All @@ -77,13 +78,7 @@ while [ $# -ne 0 ]; do
DRY_RUN="-n"
;;
-t|--test)
if [ "$(uname -s)" == "Linux" ]; then
SWIFT_PACKAGE=buildbot_linux
BUILD_SUBDIR=buildbot_linux
else
SWIFT_PACKAGE=buildbot_osx_package
BUILD_SUBDIR=buildbot_osx
fi
NO_TEST=
;;
--distcc)
DISTCC_FLAG="--distcc"
Expand All @@ -100,7 +95,7 @@ while [ $# -ne 0 ]; do
PRESET_PREFIX="$1"
;;
--use-os-runtime)
PRESET_SUFFIX=",use_os_runtime"
USE_OS_RUNTIME=",use_os_runtime"
;;
-h|--help)
usage
Expand Down Expand Up @@ -152,7 +147,7 @@ SCCACHE_FLAG="${SCCACHE_FLAG}"

./utils/build-script ${DRY_RUN} ${DISTCC_FLAG} ${PRESET_FILE_FLAGS} \
${SCCACHE_FLAG} \
--preset="${PRESET_PREFIX}${SWIFT_PACKAGE}${PRESET_SUFFIX}" \
--preset="${PRESET_PREFIX}${SWIFT_PACKAGE}${NO_TEST}${USE_OS_RUNTIME}" \
install_destdir="${SWIFT_INSTALL_DIR}" \
installable_package="${SWIFT_INSTALLABLE_PACKAGE}" \
install_toolchain_dir="${SWIFT_TOOLCHAIN_DIR}" \
Expand Down