You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update LD_RUNPATH_SEARCH_PATHS of executable built using the new Swift Build backend.
### Motivation:
For the Swift Build backend, fix a runtime issue when building & running an
executable linked against a dynamic library (from a local package dependency).
That's the runtime error I get:
dyld[89079]: Library not loaded: @rpath/libUtils.dylib
Referenced from:
/App/.build/arm64-apple-macosx/Products/Debug/App
...
### Modifications:
Update the build setting LD_RUNPATH_SEARCH_PATHS for executables,
appending @loader_path. This is actually an "imparted" build setting coming
from dynamic libraries targets, so that's where I made the change.
### Result:
Now both build configurations are capable of running the built App:
$ swift run --package-path /App --build-system swiftbuild --configuration debug
Hello from Lib
$ swift run --package-path /App --build-system swiftbuild --configuration release
Hello from Lib
0 commit comments