From e8a5d1138c992a4646d48e09aabd586342f9d75e Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Wed, 17 Jan 2024 09:57:54 -0800 Subject: [PATCH] build.rs: More consistently use named constants for OS names. --- build.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build.rs b/build.rs index 83834d420..daf2ebfbb 100644 --- a/build.rs +++ b/build.rs @@ -264,8 +264,9 @@ const LINUX_ABI: &[&str] = &[ /// Operating systems that have the same ABI as macOS on every architecture /// mentioned in `ASM_TARGETS`. -const MACOS_ABI: &[&str] = &["ios", "macos", "tvos"]; +const MACOS_ABI: &[&str] = &["ios", MACOS, "tvos"]; +const MACOS: &str = "macos"; const WINDOWS: &str = "windows"; /// Read an environment variable and tell Cargo that we depend on it. @@ -588,7 +589,7 @@ fn configure_cc(c: &mut cc::Build, target: &Target, include_dir: &Path) { let _ = c.flag(f); } - if target.os.as_str() == "macos" { + if target.os.as_str() == MACOS { // ``-gfull`` is required for Darwin's |-dead_strip|. let _ = c.flag("-gfull"); } else if !compiler.is_like_msvc() {