build.rs: More consistently use named constants for OS names.

This commit is contained in:
Brian Smith 2024-01-17 09:57:54 -08:00
parent 4e37622614
commit e8a5d1138c

View File

@ -264,8 +264,9 @@ const LINUX_ABI: &[&str] = &[
/// Operating systems that have the same ABI as macOS on every architecture /// Operating systems that have the same ABI as macOS on every architecture
/// mentioned in `ASM_TARGETS`. /// 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"; const WINDOWS: &str = "windows";
/// Read an environment variable and tell Cargo that we depend on it. /// 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); let _ = c.flag(f);
} }
if target.os.as_str() == "macos" { if target.os.as_str() == MACOS {
// ``-gfull`` is required for Darwin's |-dead_strip|. // ``-gfull`` is required for Darwin's |-dead_strip|.
let _ = c.flag("-gfull"); let _ = c.flag("-gfull");
} else if !compiler.is_like_msvc() { } else if !compiler.is_like_msvc() {