mirror of
https://github.com/GuillemCastro/spotify-dl.git
synced 2024-11-22 02:10:26 +01:00
added conditional to install on macos
This commit is contained in:
parent
1a6c1da6a1
commit
93973902bc
1 changed files with 19 additions and 2 deletions
21
build.rs
21
build.rs
|
@ -5,8 +5,25 @@ use std::path::Path;
|
||||||
fn main() {
|
fn main() {
|
||||||
let library = pkg_config::Config::new().probe("flac").unwrap();
|
let library = pkg_config::Config::new().probe("flac").unwrap();
|
||||||
let profile = env::var_os("PROFILE").unwrap();
|
let profile = env::var_os("PROFILE").unwrap();
|
||||||
let from = library.link_paths.get(0).unwrap().join("libFLAC.so");
|
|
||||||
let to = Path::new("target").join(profile).join("deps").join("libflac.so");
|
let lib_flac_from = String::from(
|
||||||
|
if env::consts::OS == "macos"{
|
||||||
|
"libFLAC.dylib"
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
"libFLAC.so"
|
||||||
|
}
|
||||||
|
);
|
||||||
|
let lib_flac_to = String::from(
|
||||||
|
if env::consts::OS == "macos"{
|
||||||
|
"libFLAC.dylib"
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
"libflac.so"
|
||||||
|
}
|
||||||
|
);
|
||||||
|
let from = library.link_paths.get(0).unwrap().join(lib_flac_from);
|
||||||
|
let to = Path::new("target").join(profile).join("deps").join(lib_flac_to);
|
||||||
fs::copy(from, to).unwrap();
|
fs::copy(from, to).unwrap();
|
||||||
println!("cargo:rerun-if-changed=build.rs");
|
println!("cargo:rerun-if-changed=build.rs");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue