Skip to content

Commit bf8a1c2

Browse files
authored
Merge pull request swiftlang#257 from buttaface/prefix
[build-script] Remove hard-coded install prefix of /usr and pass it in instead
2 parents 8efa31b + 1acf71d commit bf8a1c2

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
@@ -44,10 +44,10 @@ def get_swiftpm_options(args):
4444
swiftpm_args += [
4545
# Dispatch headers
4646
'-Xcxx', '-I', '-Xcxx',
47-
os.path.join(args.toolchain, 'usr', 'lib', 'swift'),
47+
os.path.join(args.toolchain, 'lib', 'swift'),
4848
# For <Block.h>
4949
'-Xcxx', '-I', '-Xcxx',
50-
os.path.join(args.toolchain, 'usr', 'lib', 'swift', 'Block'),
50+
os.path.join(args.toolchain, 'lib', 'swift', 'Block'),
5151
]
5252

5353
if 'ANDROID_DATA' in os.environ:
@@ -66,7 +66,7 @@ def get_swiftpm_options(args):
6666
return swiftpm_args
6767

6868
def install(swiftpm_bin_path, toolchain):
69-
toolchain_bin = os.path.join(toolchain, 'usr', 'bin')
69+
toolchain_bin = os.path.join(toolchain, 'bin')
7070
for exe in ['sourcekit-lsp']:
7171
install_binary(exe, swiftpm_bin_path, toolchain_bin, toolchain)
7272

@@ -77,7 +77,7 @@ def install_binary(exe, source_dir, install_dir, toolchain):
7777

7878
if platform.system() == 'Darwin':
7979
result_path = os.path.join(install_dir, exe)
80-
stdlib_rpath = os.path.join(toolchain, 'usr', 'lib', 'swift', 'macosx')
80+
stdlib_rpath = os.path.join(toolchain, 'lib', 'swift', 'macosx')
8181
delete_rpath(stdlib_rpath, result_path)
8282

8383
def delete_rpath(rpath, binary):
@@ -157,7 +157,7 @@ def add_common_args(parser):
157157
args.toolchain = os.path.abspath(args.toolchain)
158158

159159
if args.toolchain:
160-
swift_exec = os.path.join(args.toolchain, 'usr', 'bin', 'swift')
160+
swift_exec = os.path.join(args.toolchain, 'bin', 'swift')
161161
else:
162162
swift_exec = 'swift'
163163

0 commit comments

Comments
 (0)