Skip to content

Commit a5c659b

Browse files
authored
Merge pull request #72630 from gottesmm/pr-50ee64cfdfa1abde15b69c4775812536c445d850
[build-toolchain] Add the ability to specify that a toolchain should only build macOS.
2 parents d84847a + 470b874 commit a5c659b

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

utils/build-presets.ini

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,6 +1373,14 @@ installable-package=%(installable_package)s
13731373
[preset: mixin_osx_package,use_os_runtime]:
13741374
darwin-toolchain-require-use-os-runtime=1
13751375

1376+
[preset: mixin_osx_package,macos_only]:
1377+
skip-build-ios
1378+
skip-test-ios
1379+
skip-build-tvos
1380+
skip-test-tvos
1381+
skip-build-watchos
1382+
skip-test-watchos
1383+
13761384
[preset: buildbot_osx_package]
13771385
mixin-preset=
13781386
mixin_osx_package_base
@@ -1392,6 +1400,11 @@ mixin-preset=
13921400
buildbot_osx_package
13931401
mixin_osx_package,use_os_runtime
13941402

1403+
[preset: buildbot_osx_package,macos_only]
1404+
mixin-preset=
1405+
buildbot_osx_package
1406+
mixin_osx_package,macos_only
1407+
13951408
[preset: buildbot_osx_package,no_assertions]
13961409
mixin-preset=
13971410
mixin_osx_package_base
@@ -1475,6 +1488,13 @@ mixin-preset=
14751488
buildbot_osx_package
14761489
mixin_buildbot_osx_package,no_test
14771490

1491+
# macOS package with out test
1492+
[preset: buildbot_osx_package,no_test,macos_only]
1493+
mixin-preset=
1494+
buildbot_osx_package
1495+
mixin_buildbot_osx_package,no_test
1496+
mixin_osx_package,macos_only
1497+
14781498
# macOS package without test that when linked against uses the OS runtime
14791499
# instead of the toolchain runtime.
14801500
[preset: buildbot_osx_package,no_test,use_os_runtime]

utils/build-toolchain

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ function usage() {
3535
echo "--preset-prefix"
3636
echo "Customize the preset invoked by prepending a prefix"
3737
echo ""
38+
echo "--macos-only"
39+
echo "On Darwin, only build for macOS instead of for all platforms"
40+
echo ""
3841
echo "--use-os-runtime"
3942
echo "Require this toolchain to link against the OS runtime rather than the toolchains packaged runtime"
4043
echo ""
@@ -52,6 +55,7 @@ PRESET_FILE_FLAGS=
5255
PRESET_PREFIX=
5356
NO_TEST=",no_test"
5457
USE_OS_RUNTIME=
58+
MACOS_ONLY=
5559

5660
case $(uname -s) in
5761
Darwin)
@@ -94,6 +98,9 @@ while [ $# -ne 0 ]; do
9498
;;
9599
--use-os-runtime)
96100
USE_OS_RUNTIME=",use_os_runtime"
101+
;;
102+
--macos-only)
103+
MACOS_ONLY=",macos_only"
97104
;;
98105
-h|--help)
99106
usage
@@ -145,7 +152,7 @@ SCCACHE_FLAG="${SCCACHE_FLAG}"
145152

146153
./utils/build-script ${DRY_RUN} ${DISTCC_FLAG} ${PRESET_FILE_FLAGS} \
147154
${SCCACHE_FLAG} \
148-
--preset="${PRESET_PREFIX}${SWIFT_PACKAGE}${NO_TEST}${USE_OS_RUNTIME}" \
155+
--preset="${PRESET_PREFIX}${SWIFT_PACKAGE}${NO_TEST}${USE_OS_RUNTIME}${MACOS_ONLY}" \
149156
install_destdir="${SWIFT_INSTALL_DIR}" \
150157
installable_package="${SWIFT_INSTALLABLE_PACKAGE}" \
151158
install_toolchain_dir="${SWIFT_TOOLCHAIN_DIR}" \

0 commit comments

Comments
 (0)