Then I found that I could not use some mods such as esp_idf_svc::netif. And this is because embuild did not provide some necessary cfg conditions in the build script build.rs.
For example, esp_idf_svc::netif requires the condition esp_idf_comp_esp_netif_enabled:
// from esp-idf-svc/src/lib.rs
#[cfg(all(feature = "alloc", esp_idf_comp_esp_netif_enabled))]
pub mod netif;
And embuild::build::CfgArgs::output_propagated("ESP_IDF") in the build script doesn't provide it. But in a pure Rust project, this condition will be provided.
I wonder if this is intentional. Also, is there any way to enable mods like esp_idf_svc::netif in a mixed project?
I've updated the CMake-build README with this information. If it still does not work for you after applying the changes suggested there, please, reopen this bug, but ideally - in the esp-idf-template project,.
I created a project according to the instructions in https://github.com/esp-rs/esp-idf-template/blob/master/README-cmake.md. It's a mixed Rust/C ESP-IDF project driven by
idf.py
and CMake.Then I found that I could not use some mods such as
esp_idf_svc::netif
. And this is becauseembuild
did not provide some necessary cfg conditions in the build scriptbuild.rs
.For example,
esp_idf_svc::netif
requires the conditionesp_idf_comp_esp_netif_enabled
:And
embuild::build::CfgArgs::output_propagated("ESP_IDF")
in the build script doesn't provide it. But in a pure Rust project, this condition will be provided.I wonder if this is intentional. Also, is there any way to enable mods like
esp_idf_svc::netif
in a mixed project?