Skip to content

Commit 615140c

Browse files
authored
Merge pull request swiftlang#33524 from gottesmm/pr-4bbf9f051aa3180571b8238e3cb830bd4d0696c3
[build-toolchain] Add support for specifying a preset file.
2 parents a12ac41 + 479a148 commit 615140c

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

utils/build-toolchain

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ function usage() {
2929
echo "--distcc"
3030
echo "Build with distcc to speed up the toolchain build"
3131
echo ""
32+
echo "--preset-file"
33+
echo "load build-script presets from the specified file"
34+
echo ""
35+
echo "--preset-prefix"
36+
echo "Customize the preset invoked by prepending a prefix"
37+
echo ""
3238
}
3339

3440
RESULT_DIR=$PWD
@@ -38,6 +44,8 @@ cd "$(dirname $0)/.." || exit
3844
DISTCC_FLAG=
3945
DRY_RUN=
4046
BUNDLE_PREFIX=
47+
PRESET_FILE_FLAGS=
48+
PRESET_PREFIX=
4149
case $(uname -s) in
4250
Darwin)
4351
SWIFT_PACKAGE=buildbot_osx_package,no_test
@@ -69,6 +77,14 @@ while [ $# -ne 0 ]; do
6977
;;
7078
--distcc)
7179
DISTCC_FLAG="--distcc"
80+
;;
81+
--preset-file)
82+
shift
83+
PRESET_FILE_FLAGS="${PRESET_FILE_FLAGS} --preset-file=$1"
84+
;;
85+
--preset-prefix)
86+
shift
87+
PRESET_PREFIX="$1"
7288
;;
7389
-h|--help)
7490
usage
@@ -115,8 +131,9 @@ SWIFT_TOOLCHAIN_DIR="/Library/Developer/Toolchains/${TOOLCHAIN_NAME}.xctoolchain
115131
SYMBOLS_PACKAGE="${RESULT_DIR}/${SYM_ARCHIVE}"
116132
DRY_RUN="${DRY_RUN}"
117133
DISTCC_FLAG="${DISTCC_FLAG}"
134+
PRESET_FILE_FLAGS="${PRESET_FILE_FLAGS}"
118135

119-
./utils/build-script ${DRY_RUN} ${DISTCC_FLAG} --preset="${SWIFT_PACKAGE}" \
136+
./utils/build-script ${DRY_RUN} ${DISTCC_FLAG} ${PRESET_FILE_FLAGS} --preset="${PRESET_PREFIX}${SWIFT_PACKAGE}" \
120137
install_destdir="${SWIFT_INSTALL_DIR}" \
121138
installable_package="${SWIFT_INSTALLABLE_PACKAGE}" \
122139
install_toolchain_dir="${SWIFT_TOOLCHAIN_DIR}" \

0 commit comments

Comments
 (0)