21 lines
492 B
Rust
21 lines
492 B
Rust
// build.rs
|
|
use cmake::Config;
|
|
|
|
fn main() {
|
|
// Tell Cargo to tell rustc to link the C++ library.
|
|
println!("cargo:rustc-link-lib=static=stm32u5");
|
|
|
|
// Use cmake to build the C++ project
|
|
let dst = Config::new("stm32u5").build();
|
|
|
|
// Tell Cargo where to find the compiled library
|
|
println!("cargo:rustc-link-search=native={}", dst.display());
|
|
|
|
// get the out dir of dependcy `cortex-m`
|
|
//
|
|
println!("cargo:include=/includes") // provide DEP_U5_INCLUDE var
|
|
|
|
|
|
|
|
}
|