Skip to content

Commit

Permalink
Support CMake build on MSVC
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Rodin <[email protected]>
  • Loading branch information
a-rodin committed Nov 18, 2019
1 parent 802cb82 commit 5cd9c03
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions rdkafka-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,15 @@ fn build_librdkafka() {
config.define("CMAKE_SYSTEM_NAME", system_name);
}
let dst = config.build();
#[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);
}
#[cfg(not(target_env = "msvc"))]
println!("cargo:rustc-link-search=native={}/build/src", dst.display());
println!("cargo:rustc-link-lib=static=rdkafka");
}

0 comments on commit 5cd9c03

Please sign in to comment.