Skip to content

Commit fe77713

Browse files
committed
Fix install
1 parent a64f1d8 commit fe77713

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

Utilities/bootstrap

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

462462

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

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

0 commit comments

Comments
 (0)