Skip to content

Commit

Permalink
Merge pull request #374 from kateinoigakukun/katei/fix-rpath-for-swif…
Browse files Browse the repository at this point in the history
…t-pm

[WASM] Pass -rpath flag to find dynamic library from relative to it's executable path
  • Loading branch information
kateinoigakukun authored Mar 12, 2020
2 parents 5be35e7 + 957a782 commit 71f03fb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion utils/webassembly/build-swiftpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,15 @@ SWIFT_BUILD_FLAGS="-c release"
SWIFT_BUILD=${NIGHTLY_TOOLCHAIN}/usr/bin/swift-build

build_swiftpm() {
local build_flags=$SWIFT_BUILD_FLAGS
if [[ "$(uname)" == "Darwin" ]]; then
rpath_prefix='@executable_path/../'
else
rpath_prefix='$ORIGIN/../'
fi
build_flags="${build_flags} -Xlinker -rpath -Xlinker ${rpath_prefix}"
cd ${SOURCE_PATH}/swiftpm
${SWIFT_BUILD} ${SWIFT_BUILD_FLAGS}
${SWIFT_BUILD} ${build_flags}
}

install_binary() {
Expand Down

0 comments on commit 71f03fb

Please sign in to comment.