Skip to content

Commit dadb2bc

Browse files
committed
Respect the TOOLCHAINS environment variable if set when deciding the darwin xcrun toolchain.
1 parent c734324 commit dadb2bc

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

utils/build-script

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,11 @@ def main_normal():
10411041
shell.dry_run = args.dry_run
10421042

10431043
# Prepare and validate toolchain
1044+
env_toolchain = os.environ.get('TOOLCHAINS')
1045+
if args.darwin_xcrun_toolchain is None:
1046+
diagnostics.note('using toolchain {}'.format(env_toolchain))
1047+
args.darwin_xcrun_toolchain = env_toolchain
1048+
10441049
toolchain = host_toolchain(xcrun_toolchain=args.darwin_xcrun_toolchain)
10451050
os.environ['TOOLCHAINS'] = args.darwin_xcrun_toolchain
10461051

utils/build_swift/driver_arguments.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,6 @@ def create_argument_parser():
317317
help='the number of parallel build jobs to use')
318318

319319
option('--darwin-xcrun-toolchain', store,
320-
default=defaults.DARWIN_XCRUN_TOOLCHAIN,
321320
help='the name of the toolchain to use on Darwin')
322321
option('--cmake', store_path(executable=True),
323322
help='the path to a CMake executable that will be used to build '

utils/build_swift/tests/expected_options.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@
106106
defaults.DARWIN_DEPLOYMENT_VERSION_TVOS,
107107
'darwin_deployment_version_watchos':
108108
defaults.DARWIN_DEPLOYMENT_VERSION_WATCHOS,
109-
'darwin_xcrun_toolchain':
110-
defaults.DARWIN_XCRUN_TOOLCHAIN,
109+
'darwin_xcrun_toolchain': None,
111110
'distcc': False,
112111
'dry_run': False,
113112
'enable_asan': False,

0 commit comments

Comments
 (0)