Skip to content

Commit 1acf71d

Browse files
committed
[build-script] Remove hard-coded install prefix of /usr and pass it in instead
1 parent babf190 commit 1acf71d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Utilities/build-script-helper.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ def get_swiftpm_options(args):
4040
swiftpm_args += [
4141
# Dispatch headers
4242
'-Xcxx', '-I', '-Xcxx',
43-
os.path.join(args.toolchain, 'usr', 'lib', 'swift'),
43+
os.path.join(args.toolchain, 'lib', 'swift'),
4444
# For <Block.h>
4545
'-Xcxx', '-I', '-Xcxx',
46-
os.path.join(args.toolchain, 'usr', 'lib', 'swift', 'Block'),
46+
os.path.join(args.toolchain, 'lib', 'swift', 'Block'),
4747
]
4848

4949
if 'ANDROID_DATA' in os.environ:
@@ -62,7 +62,7 @@ def get_swiftpm_options(args):
6262
return swiftpm_args
6363

6464
def install(swiftpm_bin_path, toolchain):
65-
toolchain_bin = os.path.join(toolchain, 'usr', 'bin')
65+
toolchain_bin = os.path.join(toolchain, 'bin')
6666
for exe in ['sourcekit-lsp']:
6767
install_binary(exe, swiftpm_bin_path, toolchain_bin, toolchain)
6868

@@ -73,7 +73,7 @@ def install_binary(exe, source_dir, install_dir, toolchain):
7373

7474
if platform.system() == 'Darwin':
7575
result_path = os.path.join(install_dir, exe)
76-
stdlib_rpath = os.path.join(toolchain, 'usr', 'lib', 'swift', 'macosx')
76+
stdlib_rpath = os.path.join(toolchain, 'lib', 'swift', 'macosx')
7777
delete_rpath(stdlib_rpath, result_path)
7878

7979
def delete_rpath(rpath, binary):
@@ -110,7 +110,7 @@ def add_common_args(parser):
110110
args.toolchain = os.path.abspath(args.toolchain)
111111

112112
if args.toolchain:
113-
swift_exec = os.path.join(args.toolchain, 'usr', 'bin', 'swift')
113+
swift_exec = os.path.join(args.toolchain, 'bin', 'swift')
114114
else:
115115
swift_exec = 'swift'
116116

0 commit comments

Comments
 (0)