Skip to content

Commit

Permalink
Merge pull request #194 from benesch/build-fixes
Browse files Browse the repository at this point in the history
Use CMake's install target for proper MSVC handling
  • Loading branch information
benesch authored Dec 11, 2019
2 parents d159783 + e869969 commit b8849b5
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions rdkafka-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,7 @@ fn build_librdkafka() {
fn build_librdkafka() {
let mut config = cmake::Config::new("librdkafka");

config
.define("RDKAFKA_BUILD_STATIC", "1")
.build_target("rdkafka");
config.define("RDKAFKA_BUILD_STATIC", "1");

if env::var("CARGO_FEATURE_LIBZ").is_ok() {
config.define("WITH_ZLIB", "1");
Expand Down Expand Up @@ -230,14 +228,6 @@ fn build_librdkafka() {
println!("Configuring and compiling librdkafka");
let dst = config.build();

if cfg!(target_env = "msvc") {
let profile = match &env::var("PROFILE").expect("Cannot determine build profile")[..] {
"release" | "bench" => "Release",
_ => "Debug"
};
println!("cargo:rustc-link-search=native={}/build/src/{}", dst.display(), profile);
} else {
println!("cargo:rustc-link-search=native={}/build/src", dst.display());
}
println!("cargo:rustc-link-search=native={}/lib", dst.display());
println!("cargo:rustc-link-lib=static=rdkafka");
}

0 comments on commit b8849b5

Please sign in to comment.