Code: Untitled.cmake Select all
I have recently started learning ESP32 development using ESP-IDF. It is usually recommended to see how things are done in examples and then apply them to your project. I was trying to get started using Wi-Fi on my ESP32.
In a project I created I have to use the PRIV_REQUIRES ESP-IDF CMake directive to indicate which components my main component depends on or it won't build. I had to add esp_wifi (which makes sense), but I also had to add nvs_flash (which doesn't make sense to me as it should have been included automatically since it is a dependency of esp_wifi). On the other hand, this example Wi-Fi project https://github.com/espressif/esp-idf/tr ... /fast_scan doesn't have any components required, and it builds without any issues (I have tried it on the same PC!).
So what am I missing here? Both projects have only a single source file. Here are the main component CMakeLists files for both:
My project (created from the sample_project template):
Code: Select all
idf_component_register(SRCS "main.c"
PRIV_REQUIRES esp_wifi nvs_flash
INCLUDE_DIRS ".")
Code: Select all
idf_component_register(SRCS "fast_scan.c"
INCLUDE_DIRS ".")
Thank you.
