nix: build nova-plugin via crane to cache deps separately from crate src
This commit is contained in:
parent
2a691aa66f
commit
bf5cb913fc
4 changed files with 88 additions and 44 deletions
|
|
@ -8,7 +8,15 @@ fn main() {
|
|||
// plugin loader finds nothing exported. --export-dynamic re-exposes them.
|
||||
println!("cargo:rustc-link-arg=-Wl,--export-dynamic");
|
||||
|
||||
// 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
|
||||
// that case - we just want cxx-qt-lib (the heavy dep) cached, not our own glue.
|
||||
let bridge_files = ["src/system_stats.rs", "src/cpu_service.rs"];
|
||||
if !bridge_files.iter().all(|p| std::path::Path::new(p).exists()) {
|
||||
return;
|
||||
}
|
||||
|
||||
CxxQtBuilder::new_qml_module(QmlModule::new("NovaStats").plugin_type(PluginType::Dynamic))
|
||||
.files(["src/system_stats.rs", "src/cpu_service.rs"])
|
||||
.files(bridge_files)
|
||||
.build();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue