-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.rs
37 lines (32 loc) · 1.01 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
#[cfg(feature = "build")]
use cmake::Config;
#[cfg(feature = "build")]
use std::time::SystemTime;
#[cfg(feature = "build")]
fn main() {
println!("cargo:rerun-if-changed={:?}", SystemTime::now());
let dst = Config::new("./")
.define("MBEDTLS_USE_STATIC_LIBS", "ON")
.define("BUILD_SHARED_LIBS", "OFF")
.build();
println!("cargo:rustc-link-search=native={}", dst.display());
println!(
"cargo:rustc-link-search=native={}",
"/home/linuxbrew/.linuxbrew/lib"
);
println!("cargo:rustc-link-lib=static=crypto");
println!("cargo:rustc-link-lib=static=mbedtls");
println!("cargo:rustc-link-lib=static=mbedcrypto");
println!("cargo:rustc-link-lib=static=mbedx509");
bindgen::Builder::default()
.headers(["psa/wrapper.h"])
.use_core()
.derive_debug(true)
.generate_comments(true)
.generate()
.unwrap()
.write_to_file("src/alg/bindings.rs")
.unwrap();
}
#[cfg(not(feature = "build"))]
fn main() {}