@@ -577,13 +577,6 @@ def build_swiftpm_with_swiftpm(args, integrated_swift_driver):
577
577
if integrated_swift_driver :
578
578
swiftpm_args .append ("--use-integrated-swift-driver" )
579
579
580
- build_target = get_build_target (args )
581
- cross_compile_hosts = args .cross_compile_hosts
582
- if build_target == 'x86_64-apple-macosx' and "macosx-arm64" in cross_compile_hosts :
583
- swiftpm_args += ["--arch" , "x86_64" , "--arch" , "arm64" ]
584
- elif cross_compile_hosts :
585
- error ("cannot cross-compile for %s" % cross_compile_hosts )
586
-
587
580
call_swiftpm (args , swiftpm_args )
588
581
589
582
# Setup symlinks that'll allow using swiftpm from the build directory.
@@ -734,6 +727,13 @@ def get_swiftpm_flags(args):
734
727
if platform .system () != "Darwin" and args .command == 'install' :
735
728
build_flags .extend (["-Xswiftc" , "-no-toolchain-stdlib-rpath" ])
736
729
730
+ build_target = get_build_target (args )
731
+ cross_compile_hosts = args .cross_compile_hosts
732
+ if build_target == 'x86_64-apple-macosx' and "macosx-arm64" in cross_compile_hosts :
733
+ build_flags += ["--arch" , "x86_64" , "--arch" , "arm64" ]
734
+ elif cross_compile_hosts :
735
+ error ("cannot cross-compile for %s" % cross_compile_hosts )
736
+
737
737
return build_flags
738
738
739
739
if __name__ == '__main__' :
0 commit comments