Skip to content

Commit b87bd4f

Browse files
authored
bootstrap: generalize check for cross-compilation on Darwin (#5755)
...so that the build with swiftpm can start. This will allow to build a Swift toolchain on Apple Silicon Addresses rdar://99484030
1 parent 5b88aef commit b87bd4f

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Utilities/bootstrap

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -815,12 +815,13 @@ def get_swiftpm_flags(args):
815815

816816
build_target = get_build_target(args)
817817
cross_compile_hosts = args.cross_compile_hosts
818-
if build_target == 'x86_64-apple-macosx' and "macosx-arm64" in cross_compile_hosts:
819-
build_flags += ["--arch", "x86_64", "--arch", "arm64"]
820-
elif cross_compile_hosts and re.match('android-', cross_compile_hosts):
821-
build_flags.extend(["--destination", args.cross_compile_config])
822-
elif cross_compile_hosts:
823-
error("cannot cross-compile for %s" % cross_compile_hosts)
818+
if cross_compile_hosts:
819+
if re.search('-apple-macosx', build_target) and re.match('macosx-', cross_compile_hosts):
820+
build_flags += ["--arch", "x86_64", "--arch", "arm64"]
821+
elif re.match('android-', cross_compile_hosts):
822+
build_flags.extend(["--destination", args.cross_compile_config])
823+
else:
824+
error("cannot cross-compile for %s" % cross_compile_hosts)
824825

825826
# Ensure we are not sharing the module cache with concurrent builds in CI
826827
local_module_cache_path=os.path.join(args.build_dir, "module-cache")

0 commit comments

Comments
 (0)