Invert use_target_has_atomic cfg

This way, a build system that does not want to run Cargo build scripts
can build serde without any cfgs defined, and get the most modern
feature set.
This commit is contained in:
David Tolnay
2022-12-11 15:51:17 -08:00
parent 692ac99c69
commit 6159ead404
4 changed files with 20 additions and 21 deletions
+2 -3
View File
@@ -95,9 +95,8 @@ fn main() {
// Whitelist of archs that support std::sync::atomic module. Ideally we
// would use #[cfg(target_has_atomic = "...")] but it is not stable yet.
// Instead this is based on rustc's compiler/rustc_target/src/spec/*.rs.
if minor >= 60 {
println!("cargo:rustc-cfg=use_target_has_atomic");
} else {
if minor < 60 {
println!("cargo:rustc-cfg=no_target_has_atomic");
let has_atomic64 = target.starts_with("x86_64")
|| target.starts_with("i686")
|| target.starts_with("aarch64")