mcgoo / vcpkg-rs

Build library for finding native libraries in vcpkg for Rust - Windows (msvc), Linux and macOS
https://docs.rs/vcpkg
Apache License 2.0
108 stars 22 forks source link

allow `static` link kind for `rustc-link-lib=` #61

Open imWildCat opened 4 months ago

imWildCat commented 4 months ago
fn ios() {
    // vcpkg::find_package("icu").unwrap(); // this would build the whole rust lib but the compilation for iOS using xcode would fail due to missing symbols
    println!("cargo:rustc-link-search=native=path/to/vcpkg/installed/arm64-ios-simulator/lib");
    println!("cargo:rustc-link-lib=static=icuuc");
    println!("cargo:rustc-link-lib=static=icui18n");
    println!("cargo:rustc-link-lib=static=icudata");

only adding static= to the lib being linked can fix

https://doc.rust-lang.org/cargo/reference/build-scripts.html#:~:text=other%20linker%20options.-,cargo%3A%3Arustc%2Dlink%2Dlib%3DLIB,%2C%20or%20framework.%20See%20the%20rustc%20book%20for%20more%20detail.,-cargo%3A%3Arustc%2Dlink

Is there a way to specify this kind?