forked from bitwhip/bitwhip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.rs
39 lines (38 loc) · 1.35 KB
/
build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
fn main() {
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
match target_os.as_str() {
"macos" | "ios" => {
println!(
"cargo:rustc-link-search={}/lib",
std::env::var("FFMPEG_DIR").expect("FFMPEG_DIR")
);
}
"linux" => {
println!(
"cargo:rustc-link-search={}/lib/amd64",
std::env::var("FFMPEG_DIR").expect("FFMPEG_DIR")
);
println!(
"cargo:rustc-link-search={}/lib",
std::env::var("FFMPEG_DIR").expect("FFMPEG_DIR")
);
}
"windows" => {
println!("cargo:rustc-link-arg=/EXPORT:NvOptimusEnablement");
println!("cargo:rustc-link-arg=/EXPORT:AmdPowerXpressRequestHighPerformance");
println!(
"cargo:rustc-link-search={}\\lib\\x64",
std::env::var("FFMPEG_DIR").expect("FFMPEG_DIR")
);
println!(
"cargo:rustc-link-search={}\\lib",
std::env::var("FFMPEG_DIR").expect("FFMPEG_DIR")
);
// println!(
// "cargo:rustc-link-search={}",
// std::env::var("OPENSSL_LIBS").expect("OPENSSL_LIBS")
// );
}
tos => panic!("unknown target os {:?}!", tos),
}
}