Page 1 of 1

Including components variable in the build

Posted: Thu Dec 15, 2022 10:26 pm
by daviherc
According to this section of the Build System documentation:

https://docs.espressif.com/projects/esp ... -the-build
Including components in the build

- By default, every component is included in the build.
- If you set the COMPONENTS variable to a minimal list of components used directly by your project, then the build will expand to also include required components. The full list of components will be:
---- Components mentioned explicitly in COMPONENTS.
---- Those components’ requirements (evaluated recursively).
---- The “common” components that every component depends on.
- Setting COMPONENTS to the minimal list of required components can significantly reduce compile times.
I'm not able to understand where exactly these components can be declared, or in which file this should be added.
Should it be in the top-level CMakeLists? Should it be a variable to be set like set(COMPONENTS "partition_table;perfmon;protobuf-c; protocomm")?

If there is any open project that uses this feature?

Thank you!

Re: Including components variable in the build

Posted: Thu Dec 15, 2022 11:58 pm
by ESP_igrr
You can set this variable in the project CMakeLists.txt file, before including project.cmake. Here is an example: https://github.com/espressif/esp-idf/bl ... sts.txt#L5