Skip to content

Commit

Permalink
Merge pull request #1 from lit-robotics/windows_build
Browse files Browse the repository at this point in the history
Fix build on windows and detect env changes
  • Loading branch information
tpoisonooo authored Nov 15, 2022
2 parents b136ec6 + 07df3b5 commit 319220e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ncnn-bind/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,16 @@ fn link_to_libraries() {
} else {
println!("cargo:rustc-link-lib=dylib=ncnn");
}
println!("cargo:rustc-link-lib=dylib=pthread");

if !cfg!(windows) {
println!("cargo:rustc-link-lib=dylib=pthread");
}
}

fn main() {
println!("cargo:rerun-if-env-changed=NCNN_DIR");
println!("cargo:rerun-if-env-changed=CARGO_FEATURE_STATIC");

let include_paths: Vec<PathBuf> = if let Ok(ncnn_dir) = env::var("NCNN_DIR") {
// use prebuild ncnn dir
let dir = PathBuf::from(ncnn_dir);
Expand Down

0 comments on commit 319220e

Please sign in to comment.