@@ -450,19 +450,23 @@ def install_dylib(args, library_name, install_dir, module_names):
450
450
for module in module_names :
451
451
# If we're cross-compiling, we expect the .swiftmodule to be a directory that contains everything.
452
452
if args .cross_compile_hosts :
453
- install_binary (args , module + ".swiftmodule" , install_dir , ['Project' , '*.swiftmodule' ])
453
+ install_binary (args , module + ".swiftmodule" , install_dir , ['Project' , '*.swiftmodule' ], subpath = "Modules" )
454
454
else :
455
455
# Otherwise we have either a .swiftinterface or a .swiftmodule, plus a .swiftdoc.
456
456
if os .path .exists (os .path .join (args .bin_dir , module + ".swiftinterface" )):
457
- install_binary (args , module + ".swiftinterface" , install_dir )
457
+ install_binary (args , module + ".swiftinterface" , install_dir , subpath = "Modules" )
458
458
else :
459
- install_binary (args , module + ".swiftmodule" , install_dir )
460
- install_binary (args , module + ".swiftdoc" , install_dir )
459
+ install_binary (args , module + ".swiftmodule" , install_dir , subpath = "Modules" )
460
+ install_binary (args , module + ".swiftdoc" , install_dir , subpath = "Modules" )
461
461
462
462
463
463
# Helper function that installs a single built artifact to a particular directory. The source may be either a file or a directory.
464
- def install_binary (args , binary , destination , destination_is_directory = True , ignored_patterns = []):
465
- src = os .path .join (args .bin_dir , binary )
464
+ def install_binary (args , binary , destination , destination_is_directory = True , ignored_patterns = [], subpath = None ):
465
+ if subpath :
466
+ basepath = os .path .join (args .bin_dir , subpath )
467
+ else :
468
+ basepath = args .bin_dir
469
+ src = os .path .join (basepath , binary )
466
470
install_file (args , src , destination , destination_is_directory = destination_is_directory , ignored_patterns = ignored_patterns )
467
471
468
472
def install_file (args , src , destination , destination_is_directory = True , ignored_patterns = []):
0 commit comments