rust_binding now builds C lib Release/Debug
This commit is contained in:
parent
b703247aed
commit
5dd42a6e23
1 changed files with 11 additions and 5 deletions
|
@ -5,11 +5,17 @@ use std::env;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let mut dst = Config::new("../c_impl")
|
let mut config = Config::new("../c_impl");
|
||||||
.define("NDEBUG", "true")
|
let mut dst: PathBuf;
|
||||||
.cflag("-O3")
|
if env::var("PROFILE").unwrap().eq("release") {
|
||||||
.build();
|
config.define("CMAKE_BUILD_TYPE", "Release");
|
||||||
|
dst = config.build();
|
||||||
|
dst.push("lib");
|
||||||
|
} else {
|
||||||
|
config.define("CMAKE_BUILD_TYPE", "Debug");
|
||||||
|
dst = config.build();
|
||||||
dst.push("build");
|
dst.push("build");
|
||||||
|
}
|
||||||
|
|
||||||
println!("cargo:rustc-link-search=native={}", dst.display());
|
println!("cargo:rustc-link-search=native={}", dst.display());
|
||||||
println!("cargo:rustc-link-lib=static=UDPConnection");
|
println!("cargo:rustc-link-lib=static=UDPConnection");
|
||||||
|
|
Loading…
Reference in a new issue