diff --git a/Cargo.toml b/Cargo.toml index 0eb5f81..fc2a93b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,7 @@ license = "MIT/Apache-2.0" [features] default = [] embassy = ["dep:embassy-time"] +ble = [] [dependencies] #ch58x = { version = "0.2.0", path = "../ch32-rs-nightlies/ch58x", features = [ diff --git a/build.rs b/build.rs index fa630c5..03c2184 100644 --- a/build.rs +++ b/build.rs @@ -6,7 +6,9 @@ fn main() { fs::write(out_dir.join("libISP583.a"), include_bytes!("vendor/libISP583.a")).unwrap(); - fs::write(out_dir.join("libCH58xBLE.a"), include_bytes!("vendor/LIBCH58xBLE.a")).unwrap(); + if env::var("CARGO_FEATURE_BLE").is_ok() { + fs::write(out_dir.join("libCH58xBLE.a"), include_bytes!("vendor/LIBCH58xBLE.a")).unwrap(); + } // Put the linker script somewhere the linker can find it. fs::write(out_dir.join("link.x"), include_bytes!("link.x")).unwrap();