// build.rs use cmake::Config; fn main() { println!("cargo:hello2=/path/to/includes"); // 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 println!("cargo:include={}/include", dst.to_str().unwrap()); println!("cargo:include=/path/to/includes"); println!("cargo:hello=/path/to/includes"); }