Improve dependency gating on objdiff-core (#126)

* Reduce dependencies for no features

* Add missing deps to every feature

* Add missing `dep:`s

* Gate even more deps behind features

Removes dependency on tsify-next / wasm-bindgen unless
compiling with the wasm feature by using `#[cfg_attr]`

* Fix wasm

---------

Co-authored-by: Luke Street <luke@street.dev>
This commit is contained in:
Anghelo Carvajal
2024-10-20 23:04:29 -03:00
committed by GitHub
parent 6ff8d002f7
commit 5ef3416457
5 changed files with 39 additions and 31 deletions

View File

@@ -1,6 +1,11 @@
use std::path::{Path, PathBuf};
fn main() {
#[cfg(feature = "bindings")]
compile_protos();
}
#[cfg(feature = "bindings")]
fn compile_protos() {
use std::path::{Path, PathBuf};
let root = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("protos");
let descriptor_path = root.join("proto_descriptor.bin");
println!("cargo:rerun-if-changed={}", descriptor_path.display());