@@ -144,9 +144,6 @@ def add_build_args(parser):
144144 dest = "cross_compile_hosts" ,
145145 help = "List of cross compile hosts targets." ,
146146 default = [])
147- parser .add_argument (
148- "--cross-compile-target-triple" ,
149- help = "Swift cross-compilation target triple" )
150147 parser .add_argument (
151148 "--cross-compile-config" ,
152149 help = "Swift flags to cross-compile SPM with itself" )
@@ -285,11 +282,12 @@ def get_ninja_path(args):
285282 return call_output (["which" , "ninja" ], verbose = args .verbose )
286283
287284def 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 ."""
289286 try :
290287 command = [args .swiftc_path , '-print-target-info' ]
291288 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" ]]
293291 target_info_json = subprocess .check_output (command ,
294292 stderr = subprocess .PIPE , universal_newlines = True ).strip ()
295293 args .target_info = json .loads (target_info_json )
0 commit comments