|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
From 94271fbfcdafac911bfa9ec7bdfee7c33f6423c4 Mon Sep 17 00:00:00 2001
|
|
|
|
|
From 2fff0a56e8508e5c024bd2b0312cedae7da324f4 Mon Sep 17 00:00:00 2001
|
|
|
|
|
From: Fabio Valentini <decathorpe@gmail.com>
|
|
|
|
|
Date: Tue, 1 Aug 2023 15:13:34 +0200
|
|
|
|
|
Date: Mon, 7 Oct 2024 18:22:28 +0200
|
|
|
|
|
Subject: [PATCH] unconditionally use bindgen and pkg-config to link against
|
|
|
|
|
system libzstd
|
|
|
|
|
|
|
|
|
@ -9,7 +9,7 @@ Subject: [PATCH] unconditionally use bindgen and pkg-config to link against
|
|
|
|
|
1 file changed, 3 insertions(+), 207 deletions(-)
|
|
|
|
|
|
|
|
|
|
diff --git a/build.rs b/build.rs
|
|
|
|
|
index a77a10e..e748b4b 100644
|
|
|
|
|
index e578f60..2274c45 100644
|
|
|
|
|
--- a/build.rs
|
|
|
|
|
+++ b/build.rs
|
|
|
|
|
@@ -1,8 +1,6 @@
|
|
|
|
@ -23,7 +23,7 @@ index a77a10e..e748b4b 100644
|
|
|
|
|
fn generate_bindings(defs: Vec<&str>, headerpaths: Vec<PathBuf>) {
|
|
|
|
|
let bindings = bindgen::Builder::default().header("zstd.h");
|
|
|
|
|
#[cfg(feature = "zdict_builder")]
|
|
|
|
|
@@ -35,9 +33,6 @@ fn generate_bindings(defs: Vec<&str>, headerpaths: Vec<PathBuf>) {
|
|
|
|
|
@@ -36,9 +34,6 @@ fn generate_bindings(defs: Vec<&str>, headerpaths: Vec<PathBuf>) {
|
|
|
|
|
.expect("Could not write bindings");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -33,7 +33,7 @@ index a77a10e..e748b4b 100644
|
|
|
|
|
fn pkg_config() -> (Vec<&'static str>, Vec<PathBuf>) {
|
|
|
|
|
let library = pkg_config::Config::new()
|
|
|
|
|
.statik(true)
|
|
|
|
|
@@ -47,31 +42,6 @@ fn pkg_config() -> (Vec<&'static str>, Vec<PathBuf>) {
|
|
|
|
|
@@ -48,31 +43,6 @@ fn pkg_config() -> (Vec<&'static str>, Vec<PathBuf>) {
|
|
|
|
|
(vec!["PKG_CONFIG"], library.include_paths)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -65,7 +65,7 @@ index a77a10e..e748b4b 100644
|
|
|
|
|
/// This function would find the first flag in `flags` that is supported
|
|
|
|
|
/// and add that to `config`.
|
|
|
|
|
#[allow(dead_code)]
|
|
|
|
|
@@ -85,156 +55,6 @@ fn flag_if_supported_with_fallbacks(config: &mut cc::Build, flags: &[&str]) {
|
|
|
|
|
@@ -86,156 +56,6 @@ fn flag_if_supported_with_fallbacks(config: &mut cc::Build, flags: &[&str]) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -116,16 +116,16 @@ index a77a10e..e748b4b 100644
|
|
|
|
|
- // Note that Emscripten already provides its own C standard library so
|
|
|
|
|
- // wasm32-unknown-emscripten should not be included here.
|
|
|
|
|
- // See: https://github.com/gyscos/zstd-rs/pull/209
|
|
|
|
|
- let need_wasm_shim = env::var("TARGET").map_or(false, |target| {
|
|
|
|
|
- target == "wasm32-unknown-unknown" || target == "wasm32-wasi"
|
|
|
|
|
- });
|
|
|
|
|
- let need_wasm_shim = !cfg!(feature = "no_wasm_shim")
|
|
|
|
|
- && env::var("TARGET").map_or(false, |target| {
|
|
|
|
|
- target == "wasm32-unknown-unknown" || target.starts_with("wasm32-wasi")
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- if need_wasm_shim {
|
|
|
|
|
- cargo_print(&"rerun-if-changed=wasm-shim/stdlib.h");
|
|
|
|
|
- cargo_print(&"rerun-if-changed=wasm-shim/string.h");
|
|
|
|
|
-
|
|
|
|
|
- config.include("wasm-shim/");
|
|
|
|
|
- config.define("XXH_STATIC_ASSERT", Some("0"));
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // Some extra parameters
|
|
|
|
@ -222,7 +222,7 @@ index a77a10e..e748b4b 100644
|
|
|
|
|
/// Print a line for cargo.
|
|
|
|
|
///
|
|
|
|
|
/// If non-cargo is set, do not print anything.
|
|
|
|
|
@@ -247,32 +67,8 @@ fn cargo_print(content: &dyn fmt::Display) {
|
|
|
|
|
@@ -248,32 +68,8 @@ fn cargo_print(content: &dyn fmt::Display) {
|
|
|
|
|
fn main() {
|
|
|
|
|
cargo_print(&"rerun-if-env-changed=ZSTD_SYS_USE_PKG_CONFIG");
|
|
|
|
|
|
|
|
|
@ -257,5 +257,5 @@ index a77a10e..e748b4b 100644
|
|
|
|
|
let includes: Vec<_> = headerpaths
|
|
|
|
|
.iter()
|
|
|
|
|
--
|
|
|
|
|
2.41.0
|
|
|
|
|
2.46.2
|
|
|
|
|
|
|
|
|
|