I have observed strange behaviour when I tried to use
I have built a C++ library from source and I wanted to add a custom
-rpath with my hand-built
However, when I added following argument to my manifest:
linkerSettings: [.unsafeFlags(["-rpath", "\(libraryRoot)/lib",])]
swift build, the SPM returned following error:
error: unknown argument: '-rpath'.
swift build --verbose I have observed, that all
LinkerSettings.unsafeFlags are passed to
swiftc without the
I have therefore updated my manifest as follows:
linkerSettings: [.unsafeFlags(["-Xlinker", "-rpath", "-Xlinker", "\(libraryRoot)/lib",])]
and everything works right.
It seems a little strange to me, that I would need to prepend commands for linker with
-Xlinker when using
LinkerSettings.unsafeFlags. Isn't this a bug?