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
I have a local dynamic library. Let's call it MyLib.dylib.
I want to wrap some functionality in SPM, but testTarget in this package requires MyLib.dylib to be loaded.
I can copy this library into Resources of test target bundle, but I can't set runpath to it. Is it possible to set runpath?..
A part of package:
```swift
.target: (name: "MyTarget"),
.testTarget: (
name: "MyTargetTests",
resources: [
"Resources/MyLib.dylib" // A copy of this library in Resources. It will be copied
],
linkerSettings: [
.unsafeFlags([
"-L",
"../../LibraryPath" // A link to an actual library location
"-l",
"MyLib.dylib",
"-rpath",
"@loader_path/../Resources"
])
]
)
```
Notes
Yes, I have a cheat here, I put a link to a folder ("../../LibraryPath") with this library into a package's root, so, compiler can find it.
But I don't understand how to set runpath for this target that linker can load it correctly.
The text was updated successfully, but these errors were encountered:
Additional Detail from JIRA
md5: 6382a0f1b00bde8d3f1846d38ffc4c10
Issue Description:
I have a local dynamic library. Let's call it MyLib.dylib.
I want to wrap some functionality in SPM, but testTarget in this package requires MyLib.dylib to be loaded.
I can copy this library into Resources of test target bundle, but I can't set runpath to it. Is it possible to set runpath?..
A part of package:
```swift
.target: (name: "MyTarget"),
.testTarget: (
name: "MyTargetTests",
resources: [
"Resources/MyLib.dylib" // A copy of this library in Resources. It will be copied
],
linkerSettings: [
.unsafeFlags([
"-L",
"../../LibraryPath" // A link to an actual library location
"-l",
"MyLib.dylib",
"-rpath",
"@loader_path/../Resources"
])
]
)
```
Notes
Yes, I have a cheat here, I put a link to a folder ("../../LibraryPath") with this library into a package's root, so, compiler can find it.
But I don't understand how to set runpath for this target that linker can load it correctly.
The text was updated successfully, but these errors were encountered: