This repository has been archived on 2024-05-28. You can view files and clone it, but cannot push or open issues or pull requests.
stm32u5_cargo/build.rs
2023-11-14 22:04:59 -05:00

20 lines
514 B
Rust

// build.rs
use cmake::Config;
fn main() {
// set target to thumbv8m.main-none-eabi
// let out_dir = std::env::var("OUT_DIR").unwrap();
println!("cargo:rustc-cfg=feature=\"cortex-m\"");
// 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={}", dst.display());
}