From b3db577a0f4f643796835abfab349cef2aae93c5 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Thu, 14 Apr 2022 17:30:40 -0700 Subject: [PATCH] Build against the local dynamic libxxhash installation --- Cargo.toml | 4 +--- build.rs | 9 ++------- 2 files changed, 3 insertions(+), 10 deletions(-) --- xxhash-c-sys.orig/Cargo.toml +++ xxhash-c-sys/Cargo.toml @@ -17,8 +17,6 @@ build = "build.rs" include = [ "**/*.rs", - "**/*.c", - "**/*.h", "Cargo.toml", "README.md", "LICENSE", @@ -51,8 +49,8 @@ version = "0.2" default-features = false -[build-dependencies.cc] -version = "1" +[build-dependencies.pkg-config] +version = "0.3" [features] no_std = [] --- xxhash-c-sys.orig/build.rs +++ xxhash-c-sys/build.rs @@ -1,12 +1,6 @@ fn main() { - let mut cc = cc::Build::new(); - - cc.include("src/c/"); - #[cfg(feature = "no_std")] - cc.define("XXH_NO_STDLIB", None); - - cc.file("src/c/xxhash.c"); - cc.warnings(false); - - cc.compile("xxhash"); + pkg_config::Config::new() + .atleast_version("0.8.3") + .probe("libxxhash") + .unwrap(); }