Skip to content

Commit 9f52f50

Browse files
committed
Merge branch 'master' of github.com:Prior99/libsamplerate-sys
2 parents 97408da + fef1e7a commit 9f52f50

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

build.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,20 @@ fn run(cmd: &mut Command) {
1515
}
1616

1717
fn build_libsamplerate_unix(src: &PathBuf, dst: &PathBuf) {
18-
run(Command::new("cmake").args(&["-DCMAKE_C_FLAGS=-fPIC", diff_paths(&src, &dst).unwrap().to_str().unwrap()]).current_dir(&dst));
18+
run(Command::new("cmake")
19+
.args(&[
20+
"-DCMAKE_C_FLAGS=-fPIC",
21+
&format!(
22+
"-DCMAKE_BUILD_TYPE={}",
23+
if env::var("PROFILE").map(|x| x == "release").unwrap_or(false) {
24+
"Release"
25+
} else {
26+
"Debug"
27+
}
28+
),
29+
diff_paths(&src, &dst).unwrap().to_str().unwrap(),
30+
])
31+
.current_dir(&dst));
1932
run(Command::new("make").args(&["samplerate"]).current_dir(&dst));
2033
let shlib = src.join("src/.libs");
2134
let _ = fs::copy(&shlib.join("libsamplerate.a"), &dst.join("libsamplerate.a"));

0 commit comments

Comments
 (0)