Skip to content

Commit 4948122

Browse files
committed
Cross-compile flags should be in get_swiftpm_flags
These flags were only passed for regular builds, but not for testing or other actions. rdar://problem/68542579 (cherry picked from commit f691b1e)
1 parent 59b74d5 commit 4948122

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Utilities/bootstrap

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -472,13 +472,6 @@ def build_swiftpm_with_swiftpm(args):
472472
"--disable-sandbox",
473473
]
474474

475-
build_target = get_build_target(args)
476-
cross_compile_hosts = args.cross_compile_hosts
477-
if build_target == 'x86_64-apple-macosx' and "macosx-arm64" in cross_compile_hosts:
478-
swiftpm_args += ["--arch", "x86_64", "--arch", "arm64"]
479-
elif cross_compile_hosts:
480-
error("cannot cross-compile for %s" % cross_compile_hosts)
481-
482475
call_swiftpm(args, swiftpm_args)
483476

484477
# Setup symlinks that'll allow using swiftpm from the build directory.
@@ -610,6 +603,13 @@ def get_swiftpm_flags(args):
610603
if 'ANDROID_DATA' in os.environ:
611604
build_flags.extend(["-Xswiftc", "-Xcc", "-Xswiftc", "-U_GNU_SOURCE"])
612605

606+
build_target = get_build_target(args)
607+
cross_compile_hosts = args.cross_compile_hosts
608+
if build_target == 'x86_64-apple-macosx' and "macosx-arm64" in cross_compile_hosts:
609+
build_flags += ["--arch", "x86_64", "--arch", "arm64"]
610+
elif cross_compile_hosts:
611+
error("cannot cross-compile for %s" % cross_compile_hosts)
612+
613613
return build_flags
614614

615615
if __name__ == '__main__':

0 commit comments

Comments
 (0)