Skip to content

Commit 81a696c

Browse files
Merge branch 'swiftwasm' into merge/2020-03-13
2 parents 5e2f22e + 71f03fb commit 81a696c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

utils/webassembly/build-swiftpm.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,15 @@ SWIFT_BUILD_FLAGS="-c release"
1010
SWIFT_BUILD=${NIGHTLY_TOOLCHAIN}/usr/bin/swift-build
1111

1212
build_swiftpm() {
13+
local build_flags=$SWIFT_BUILD_FLAGS
14+
if [[ "$(uname)" == "Darwin" ]]; then
15+
rpath_prefix='@executable_path/../'
16+
else
17+
rpath_prefix='$ORIGIN/../'
18+
fi
19+
build_flags="${build_flags} -Xlinker -rpath -Xlinker ${rpath_prefix}"
1320
cd ${SOURCE_PATH}/swiftpm
14-
${SWIFT_BUILD} ${SWIFT_BUILD_FLAGS}
21+
${SWIFT_BUILD} ${build_flags}
1522
}
1623

1724
install_binary() {

0 commit comments

Comments
 (0)