From d16601442479115664a2eaa37a592d50bcc7619d Mon Sep 17 00:00:00 2001 From: David Blewett Date: Fri, 25 Aug 2023 09:05:03 -0400 Subject: [PATCH] Copy the curl static library into `/lib`, so that cmake finds it. --- rdkafka-sys/build.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rdkafka-sys/build.rs b/rdkafka-sys/build.rs index 6ad8e9304..73933279d 100644 --- a/rdkafka-sys/build.rs +++ b/rdkafka-sys/build.rs @@ -1,6 +1,8 @@ use std::borrow::Borrow; use std::env; use std::ffi::OsStr; +#[cfg(feature = "cmake-build")] +use std::fs; use std::path::{Path, PathBuf}; use std::process::{self, Command}; @@ -234,6 +236,14 @@ fn build_librdkafka() { config.cxxflag("-DCURL_STATICLIB"); config.cflag(format!("-I{}/include", curl_root)); config.cxxflag(format!("-I{}/include", curl_root)); + config.cflag(format!("-L{}/lib", curl_root)); + config.cxxflag(format!("-L{}/lib", curl_root)); + //FIXME: Upstream should be copying this in their build.rs + fs::copy( + format!("{}/build/libcurl.a", curl_root), + format!("{}/lib/libcurl.a", curl_root), + ) + .unwrap(); } } else { config.define("WITH_CURL", "0");