Skip to content

Commit 6420e54

Browse files
committed
Add logging feature
1 parent f1c50c9 commit 6420e54

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ llvm-tools = { version = "0.1.1", optional = true }
4444
default = ["llvm-objcopy"]
4545
arm-none-eabi-objcopy = []
4646
llvm-objcopy = ["dep:llvm-tools"]
47+
log = []
4748

4849
nrf9160 = []
4950
nrf9151 = ["nrf9120"]

build.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,18 @@ fn main() {
9595
std::fs::write(bindings_out_path, rust_source).expect("Couldn't write updated bindgen output");
9696

9797
#[cfg(feature = "nrf9160")]
98-
let libmodem_original_path =
99-
Path::new(&nrfxlib_path).join("nrf_modem/lib/cellular/nrf9160/hard-float/libmodem.a");
98+
let libmodem_original_path = if cfg!(feature = "log") {
99+
Path::new(&nrfxlib_path).join("nrf_modem/lib/cellular/nrf9160/hard-float/libmodem_log.a")
100+
} else {
101+
Path::new(&nrfxlib_path).join("nrf_modem/lib/cellular/nrf9160/hard-float/libmodem.a")
102+
};
100103

101104
#[cfg(feature = "nrf9120")]
102-
let libmodem_original_path =
103-
Path::new(&nrfxlib_path).join("nrf_modem/lib/cellular/nrf9120/hard-float/libmodem.a");
105+
let libmodem_original_path = if cfg!(feature = "log") {
106+
Path::new(&nrfxlib_path).join("nrf_modem/lib/cellular/nrf9120/hard-float/libmodem_log.a")
107+
} else {
108+
Path::new(&nrfxlib_path).join("nrf_modem/lib/cellular/nrf9120/hard-float/libmodem.a")
109+
};
104110

105111
let libmodem_changed_path = PathBuf::from(env::var("OUT_DIR").unwrap()).join("libmodem.a");
106112

0 commit comments

Comments
 (0)