Skip to content

Commit

Permalink
Use the Cargo.toml version of the check-cfg squelching
Browse files Browse the repository at this point in the history
  • Loading branch information
glandium committed Sep 20, 2024
1 parent a09b66e commit 378a7f2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,7 @@ required-features = ["static-curl", "ssl"]
name = "multi-dl"
path = "examples/multi-dl.rs"
required-features = ["ssl"]

[lints.rust.unexpected_cfgs]
level = "warn"
check-cfg = ["cfg(need_openssl_init, need_openssl_probe)"]
6 changes: 0 additions & 6 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
use std::env;

fn main() {
println!(
"cargo::rustc-check-cfg=cfg(\
need_openssl_init,\
need_openssl_probe,\
)"
);
// OpenSSL >= 1.1.0 can be initialized concurrently and is initialized correctly by libcurl.
// <= 1.0.2 need locking callbacks, which are provided by openssl_sys::init().
let use_openssl = match env::var("DEP_OPENSSL_VERSION_NUMBER") {
Expand Down
4 changes: 4 additions & 0 deletions curl-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,7 @@ zlib-ng-compat = ["libz-sys/zlib-ng", "static-curl"]
upkeep_7_62_0 = []
poll_7_68_0 = []
ntlm = []

[lints.rust.unexpected_cfgs]
level = "warn"
check-cfg = ["cfg(libcurl_vendored,link_libnghttp2,link_libz,link_openssl)"]
8 changes: 0 additions & 8 deletions curl-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@ use std::process::Command;

fn main() {
println!("cargo:rerun-if-changed=curl");
println!(
"cargo::rustc-check-cfg=cfg(\
libcurl_vendored,\
link_libnghttp2,\
link_libz,\
link_openssl,\
)"
);
let target = env::var("TARGET").unwrap();
let windows = target.contains("windows");

Expand Down

0 comments on commit 378a7f2

Please sign in to comment.