Skip to content

Commit

Permalink
Define known cfgs in serde build.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed May 5, 2024
1 parent cc865ac commit 07c07d2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions serde/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@ use std::str::{self, FromStr};
fn main() {
println!("cargo:rerun-if-changed=build.rs");

println!("cargo:rustc-check-cfg=cfg(doc_cfg)");
println!("cargo:rustc-check-cfg=cfg(no_core_cstr)");
println!("cargo:rustc-check-cfg=cfg(no_core_num_saturating)");
println!("cargo:rustc-check-cfg=cfg(no_core_try_from)");
println!("cargo:rustc-check-cfg=cfg(no_float_copysign)");
println!("cargo:rustc-check-cfg=cfg(no_num_nonzero_signed)");
println!("cargo:rustc-check-cfg=cfg(no_relaxed_trait_bounds)");
println!("cargo:rustc-check-cfg=cfg(no_serde_derive)");
println!("cargo:rustc-check-cfg=cfg(no_std_atomic)");
println!("cargo:rustc-check-cfg=cfg(no_std_atomic64)");
println!("cargo:rustc-check-cfg=cfg(no_systemtime_checked_add)");
println!("cargo:rustc-check-cfg=cfg(no_target_has_atomic)");

let minor = match rustc_minor_version() {
Some(minor) => minor,
None => return,
Expand Down

0 comments on commit 07c07d2

Please sign in to comment.