Skip to content

Commit b80b061

Browse files
committed
Merge pull request #120 from ddunbar/SR-1631
[build] Add an rpath of $ORIGIN.
2 parents 4f7b21c + eb46e08 commit b80b061

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

build_script.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ def build(args):
155155
source_paths=" ".join(sourcePaths)))
156156
run("{swiftc} -emit-library {build_dir}/XCTest.o "
157157
"-L {foundation_build_dir} -lswiftGlibc -lswiftCore -lFoundation -lm "
158+
# We embed an rpath of `$ORIGIN` to ensure other referenced
159+
# libraries (like `Foundation`) can be found solely via XCTest.
160+
"-Xlinker -rpath=\\$ORIGIN "
158161
"-o {build_dir}/libXCTest.so".format(
159162
swiftc=swiftc,
160163
build_dir=build_dir,

0 commit comments

Comments
 (0)