@@ -77,23 +77,26 @@ def run_swift_build(host_target, product, swiftpm_package_product_name, set_inst
77
77
# Building with the freshly-built SwiftPM
78
78
swift_build = os .path .join (product .install_toolchain_path (host_target ), "bin" , "swift-build" )
79
79
80
- build_os = host_target .split ('-' )[0 ]
81
- if set_installation_rpath and not host_target .startswith ('macos' ):
80
+ if host_target .startswith ('macos' ):
81
+ # Universal binary on macOS
82
+ platform_args = ['--arch' , 'x86_64' , '--arch' , 'arm64' ]
83
+ elif set_installation_rpath :
82
84
# Library rpath for swift, dispatch, Foundation, etc. when installing
83
- rpath_args = [
85
+ build_os = host_target .split ('-' )[0 ]
86
+ platform_args = [
84
87
'--disable-local-rpath' , '-Xswiftc' , '-no-toolchain-stdlib-rpath' ,
85
88
'-Xlinker' , '-rpath' , '-Xlinker' , '$ORIGIN/../lib/swift/' + build_os
86
89
]
87
90
else :
88
- rpath_args = []
91
+ platform_args = []
89
92
90
93
build_args = [
91
94
swift_build ,
92
95
'--product' , swiftpm_package_product_name ,
93
96
'--package-path' , os .path .join (product .source_dir ),
94
97
'--build-path' , product .build_dir ,
95
98
'--configuration' , 'release' ,
96
- ] + rpath_args
99
+ ] + platform_args
97
100
98
101
if product .args .verbose_build :
99
102
build_args .append ('--verbose' )
0 commit comments