I tried to link against a private framework in /System/Library/PrivateFrameworks
using
#[link(name = "MultitouchSupport", kind = "framework")]
But the linker tells me that the MultitouchSupport framework was not found. I also tried
#[link(name = "/System/Library/PrivateFrameworks/MultitouchSupport", kind = "framework")]
and
#[link(name = "/System/Library/PrivateFrameworks/MultitouchSupport.framework", kind = "framework")]
with the file extension, but neither work.
Is it even possible to link against frameworks that are not in the standard location of /System/Library/Frameworks
?
To include a framework in your Xcode project, choose Project > Add to Project and select the framework directory. Alternatively, you can control-click your project group and choose Add Files > Existing Frameworks from the contextual menu.
A framework is a hierarchical directory that encapsulates shared resources, such as a dynamic shared library, nib files, image files, localized strings, header files, and reference documentation in a single package. Multiple applications can use all of these resources simultaneously.
I found out that WiSaGaN's suggestion was quite close to the solution: It works if you use search=framework in the build.rs. The solution was to use the following build.rs:
fn main()
{
println!("cargo:rustc-link-search=framework={}", "/System/Library/PrivateFrameworks");
}
Thank you, WiSaGaN!
Using this build.rs you can link as usual:
#[link(name = "MultitouchSupport", kind = "framework")]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With