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