@@ -144,9 +144,6 @@ def add_build_args(parser):
144
144
dest = "cross_compile_hosts" ,
145
145
help = "List of cross compile hosts targets." ,
146
146
default = [])
147
- parser .add_argument (
148
- "--cross-compile-target-triple" ,
149
- help = "Swift cross-compilation target triple" )
150
147
parser .add_argument (
151
148
"--cross-compile-config" ,
152
149
help = "Swift flags to cross-compile SPM with itself" )
@@ -285,11 +282,12 @@ def get_ninja_path(args):
285
282
return call_output (["which" , "ninja" ], verbose = args .verbose )
286
283
287
284
def get_build_target (args , cross_compile = False ):
288
- """Returns the target-triple of the current machine."""
285
+ """Returns the target-triple of the current machine or for cross-compilation ."""
289
286
try :
290
287
command = [args .swiftc_path , '-print-target-info' ]
291
288
if cross_compile :
292
- command += ['-target' , args .cross_compile_target_triple ]
289
+ cross_compile_json = json .load (open (args .cross_compile_config ))
290
+ command += ['-target' , cross_compile_json ["target" ]]
293
291
target_info_json = subprocess .check_output (command ,
294
292
stderr = subprocess .PIPE , universal_newlines = True ).strip ()
295
293
args .target_info = json .loads (target_info_json )
0 commit comments