boring-sys: Configure "rustc-cdylib-link-arg" only for macOS targets
cfg!() is evaluated for the host OS executing build.rs script. What we need here is to look whether we are building *for* macOS. Otherwise, for example, builds for iOS on macOS will try to add this flag, causing warnings since rustc does not build cdylibs on iOS.
This commit is contained in:
parent
11910f1e7c
commit
51e99ea9c0
|
|
@ -355,7 +355,8 @@ fn main() {
|
|||
println!("cargo:rustc-link-lib=static=ssl");
|
||||
|
||||
// MacOS: Allow cdylib to link with undefined symbols
|
||||
if cfg!(target_os = "macos") {
|
||||
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
|
||||
if target_os == "macos" {
|
||||
println!("cargo:rustc-cdylib-link-arg=-Wl,-undefined,dynamic_lookup");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue