From f54584a03cd06a55a460a94c260fddc0d9f8c4e2 Mon Sep 17 00:00:00 2001 From: Palkovsky Date: Tue, 20 Dec 2022 12:32:55 +0100 Subject: [PATCH] Use CARGO_CFG_TARGET_OS instead of cfg!(target_os) --- hyperscan-sys/build.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hyperscan-sys/build.rs b/hyperscan-sys/build.rs index 5961962..2963b4a 100644 --- a/hyperscan-sys/build.rs +++ b/hyperscan-sys/build.rs @@ -31,7 +31,8 @@ fn find_hyperscan() -> Result { cargo_emit::rustc_link_search!(link_path.to_string_lossy() => "native"); if cfg!(feature = "static") { - let std_link = if cfg!(target_os = "macos") { "c++" } else { "stdc++" }; + let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap(); + let std_link = if target_os == "macos" { "c++" } else { "stdc++" }; if static_libstd { cargo_emit::rustc_link_lib!(std_link => "static:-bundle"); } else {