Skip to content

Commit

Permalink
build.rs: use build_target()
Browse files Browse the repository at this point in the history
Fixes Prior99#8.
  • Loading branch information
mgeier committed Nov 15, 2020
1 parent 10f94cc commit f86d737
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ use std::env;
use std::path::PathBuf;

fn main() {
let libsr = cmake::build("libsamplerate");
println!("cargo:rustc-link-search=native={}", libsr.join("lib").display());
let mut libsr_config = cmake::Config::new("libsamplerate");
let libsr = libsr_config.build_target("samplerate").build();

println!("cargo:rustc-link-search=native={}", libsr.join("build").display());
// Debug/Release paths for MSVC:
println!("cargo:rustc-link-search=native={}", libsr.join("build").join("Debug").display());
println!("cargo:rustc-link-search=native={}", libsr.join("build").join("Release").display());
println!("cargo:rustc-link-lib=static=samplerate");

let bindings = bindgen::Builder::default()
Expand Down

0 comments on commit f86d737

Please sign in to comment.