Skip to content

Commit 8a784a6

Browse files
committed
Fix install
1 parent e176675 commit 8a784a6

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

Utilities/bootstrap

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -451,19 +451,23 @@ def install_dylib(args, library_name, install_dir, module_names):
451451
for module in module_names:
452452
# If we're cross-compiling, we expect the .swiftmodule to be a directory that contains everything.
453453
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")
455455
else:
456456
# Otherwise we have either a .swiftinterface or a .swiftmodule, plus a .swiftdoc.
457457
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")
459459
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")
462462

463463

464464
# 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)
467471
install_file(args, src, destination, destination_is_directory=destination_is_directory, ignored_patterns=ignored_patterns)
468472

469473
def install_file(args, src, destination, destination_is_directory=True, ignored_patterns=[]):

0 commit comments

Comments
 (0)