Including components variable in the build

daviherc
Posts: 10
Joined: Wed Apr 28, 2021 5:31 pm

Including components variable in the build

Postby daviherc » Thu Dec 15, 2022 10:26 pm

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!

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: Including components variable in the build

Postby ESP_igrr » Thu Dec 15, 2022 11:58 pm

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

Who is online

Users browsing this forum: Majestic-12 [Bot] and 211 guests