diff --git a/libcoap-sys/build.rs b/libcoap-sys/build.rs index 151b12c..1b6a378 100644 --- a/libcoap-sys/build.rs +++ b/libcoap-sys/build.rs @@ -46,8 +46,9 @@ fn main() { let out_dir = env::var_os("OUT_DIR").unwrap(); if cfg!(feature = "esp") { + embuild::espidf::sysenv::output(); let esp_idf_root = env::var_os("DEP_ESP_IDF_ROOT").unwrap(); - let esp_include_path = embuild::build::CInclArgs::try_from_env("ESP_IDF").unwrap(); + let esp_include_path = embuild::espidf::sysenv::cincl_args().ok_or("missing ESP dep"); let arg_splitter = regex::Regex::new(r##"(?:[^\\]"[^"]*[^\\]")?(\s)"##).unwrap(); let apostrophe_remover = regex::Regex::new(r##"^"(?.*)"$"##).unwrap(); @@ -58,8 +59,8 @@ fn main() { .clang_args(&esp_clang_args) .clang_arg("-target") .clang_arg("xtensa") // Will need to be adjusted for RISC-V ESPs, workaround according to https://github.com/esp-rs/esp-idf-sys/blob/7a0747614cdd3a65cf4ac8094bbeebfee980dbb2/build/build.rs#L119 - .clang_arg("-DESP_PLATFORM") - .clang_arg(format!("-I{}/managed_components/espressif__coap/libcoap/include", esp_idf_root.to_string_lossy())); + .clang_arg("-DESP_PLATFORM"); + //.clang_arg(format!("-I{}/managed_components/espressif__coap/libcoap/include", esp_idf_root.to_string_lossy())); //for arg in &esp_clang_args { // println!("cargo:warning={}", arg); //}