-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.rs
31 lines (25 loc) · 1005 Bytes
/
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
use std::env;
fn main() {
// link to the SAPI library
println!("cargo:rustc-link-lib=sapi");
// if the user wants to use tcti-socket then link it in
if env::var("CARGO_FEATURE_TCTI_SOCKET").is_ok() {
println!("cargo:rustc-link-lib=tcti-socket");
}
// if the user wants to use tcti-device then link it in
if env::var("CARGO_FEATURE_TCTI_DEVICE").is_ok() {
println!("cargo:rustc-link-lib=tcti-device");
}
// add to the search path anything set in the SAPI_LIBS_PATH
if let Ok(path) = env::var("SAPI_LIBS_PATH") {
println!("cargo:rustc-link-search={}", path);
}
// add to the search path anything set in the TCTI_DEV_LIBS_PATH
if let Ok(path) = env::var("TCTI_DEV_LIBS_PATH") {
println!("cargo:rustc-link-search={}", path);
}
// add to the search path anything set in the TCTI_SOCK_LIBS_PATH
if let Ok(path) = env::var("TCTI_SOCK_LIBS_PATH") {
println!("cargo:rustc-link-search={}", path);
}
}