From 6e4318bbf8e83e138c82c5a497c9d7f4b4c093c3 Mon Sep 17 00:00:00 2001 From: Putta Khunchalee Date: Sat, 7 Oct 2023 22:21:33 +0700 Subject: [PATCH] Fixes incorrect library name for zstd --- stage0/build.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/stage0/build.rs b/stage0/build.rs index 43466fc..5edadeb 100644 --- a/stage0/build.rs +++ b/stage0/build.rs @@ -71,13 +71,19 @@ fn main() { println!("cargo:rustc-link-lib=LLVMDemangle"); // Link zstd. + let os = std::env::var("CARGO_CFG_TARGET_OS").unwrap(); let zstd = std::env::var("ZSTD_PREFIX").unwrap(); println!("cargo:rustc-link-search={}/lib", zstd); - println!("cargo:rustc-link-lib=zstd"); + + if os == "windows" { + println!("cargo:rustc-link-lib=zstd_static"); + } else { + println!("cargo:rustc-link-lib=zstd"); + } // Link C++. - match std::env::var("CARGO_CFG_TARGET_OS").unwrap().as_str() { + match os.as_str() { "linux" => { let profile = std::env::var("PROFILE").unwrap();