plugin: log build.rs bridge-file presence; use manifest dir for robust path
This commit is contained in:
parent
fa861a4399
commit
78abe800ed
1 changed files with 10 additions and 1 deletions
|
|
@ -26,8 +26,17 @@ fn main() {
|
||||||
// Crane's deps-only build stubs out lib.rs and removes our bridge sources to
|
// Crane's deps-only build stubs out lib.rs and removes our bridge sources to
|
||||||
// build a dummy crate that only compiles dependencies. Skip cxx-qt codegen in
|
// build a dummy crate that only compiles dependencies. Skip cxx-qt codegen in
|
||||||
// that case - we just want cxx-qt-lib (the heavy dep) cached, not our own glue.
|
// that case - we just want cxx-qt-lib (the heavy dep) cached, not our own glue.
|
||||||
|
// Use CARGO_MANIFEST_DIR for a robust path that doesn't depend on cargo's CWD.
|
||||||
|
let manifest = std::path::Path::new(env!("CARGO_MANIFEST_DIR"));
|
||||||
let bridge_files = ["src/system_stats.rs", "src/cpu_service.rs"];
|
let bridge_files = ["src/system_stats.rs", "src/cpu_service.rs"];
|
||||||
if !bridge_files.iter().all(|p| std::path::Path::new(p).exists()) {
|
let present: Vec<bool> = bridge_files
|
||||||
|
.iter()
|
||||||
|
.map(|p| manifest.join(p).exists())
|
||||||
|
.collect();
|
||||||
|
println!("cargo:warning=build.rs manifest_dir={}", manifest.display());
|
||||||
|
println!("cargo:warning=build.rs bridge_files present: {present:?}");
|
||||||
|
if !present.iter().all(|b| *b) {
|
||||||
|
println!("cargo:warning=build.rs bailing: bridge files missing (deps-only build?)");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue