diff options
author | gnzlbg <gonzalobg88@gmail.com> | 2019-08-16 15:22:56 +0200 |
---|---|---|
committer | gnzlbg <gonzalobg88@gmail.com> | 2019-08-16 15:47:00 +0200 |
commit | 3241ec58085a2256b88be01efa505c0509f89ce0 (patch) | |
tree | 5e9d1e9317ecf7c9bd6ac662c0fa7153b796781a /build.rs | |
parent | dab1050e408b07e2f1d917072069238f5f992b9f (diff) | |
download | rust-libc-3241ec58085a2256b88be01efa505c0509f89ce0.tar.gz |
Do not deny warnings by default.
libc currently denies all warnings by default. This commit denies
warnings only when libc is built in CI.
Diffstat (limited to 'build.rs')
-rw-r--r-- | build.rs | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -7,7 +7,6 @@ fn main() { rustc_minor_version().expect("Failed to get rustc version"); let rustc_dep_of_std = env::var("CARGO_FEATURE_RUSTC_DEP_OF_STD").is_ok(); let align_cargo_feature = env::var("CARGO_FEATURE_ALIGN").is_ok(); - #[allow(unused)] let libc_ci = env::var("LIBC_CI").is_ok(); if env::var("CARGO_FEATURE_USE_STD").is_ok() { @@ -28,6 +27,11 @@ fn main() { Some(_) | None => println!("cargo:rustc-cfg=freebsd11"), } + // On CI: deny all warnings + if libc_ci { + println!("cargo:rustc-cfg=libc_deny_warnings"); + } + // Rust >= 1.15 supports private module use: if rustc_minor_ver >= 15 || rustc_dep_of_std { println!("cargo:rustc-cfg=libc_priv_mod_use"); |