After a project config change or clean, 'idf.py build' compiles every esp-idf library component regardless of whether the components are used in the project or not.
Is there any way to avoid compiling 1000+ source files when building even just a simple blank test project?
An example:
. ~/ESP32/esp-idf-v4.4.2/export.sh
idf.py create-project cli_test
cd cli_test/
idf.py set-target esp32
idf.py menuconfig
idf.py build
idf.py clean
idf.py build
[74/1035] Building C object esp-idf/mbedtls/mbedtls/library/CMakeFiles/mbedcrypto.dir/home/l.../programming/ESP32/Eclipse_ESP-IDF/esp-idf-v4.4.2/components/mbedtls/port/esp_hardware.c.obj^C
ninja: build stopped: interrupted by user.
idf.py build compiles every esp-idf library component
Re: idf.py build compiles every esp-idf library component
Hi laczik,
Yes, it's possible by setting the COMPONENTS variable in your project CMakeLists.txt file to just your 'main' component, and then declaring dependencies of the main component via REQUIRES and PRIV_REQUIRES arguments of idf_component_register.
Please check https://docs.espressif.com/projects/esp ... -variables and https://docs.espressif.com/projects/esp ... quirements.
With this change, in the current master branch the build system should build around 500 files. That's still a fair bit more than we'd like for a minimal build, and we are working on improvements to component dependencies structure to reduce this number.
I would also recommend installing ccache and setting IDF_CCACHE_ENABLE=1 environment variable. This should reduce the time of a "clean" build very significantly.
Yes, it's possible by setting the COMPONENTS variable in your project CMakeLists.txt file to just your 'main' component, and then declaring dependencies of the main component via REQUIRES and PRIV_REQUIRES arguments of idf_component_register.
Please check https://docs.espressif.com/projects/esp ... -variables and https://docs.espressif.com/projects/esp ... quirements.
With this change, in the current master branch the build system should build around 500 files. That's still a fair bit more than we'd like for a minimal build, and we are working on improvements to component dependencies structure to reduce this number.
I would also recommend installing ccache and setting IDF_CCACHE_ENABLE=1 environment variable. This should reduce the time of a "clean" build very significantly.
Re: idf.py build compiles every esp-idf library component
Thank you!
I am now down to 668 instead of 1000+ for my project proper...
I am now down to 668 instead of 1000+ for my project proper...
Who is online
Users browsing this forum: No registered users and 354 guests