Limiting compilation of all libraries

jcdmelo
Posts: 2
Joined: Fri Oct 25, 2019 11:44 am

Limiting compilation of all libraries

Postby jcdmelo » Fri Oct 25, 2019 1:19 pm

Hi, everyone,

I am new to the ESP-IDF environment, and I noticed that when I compile a project from the "examples" directory, ALL libraries in the "components" directory are compiled, even though I am not making any references to most of them.

Another issue is that for every project, all compiled libraries are created in a "build" directory which holds a substantial amount of data (around 100 MB is typical). After compiling 10 projects, I get close to 1 GB of data.

I am wondering if it would be possible (and how to do that):
1. to specify the libraries which are specific to my project (say, I am not using SPI, so I would not need to compile it);
2. to direct the output of the compilation of the libraries to a single/general "build" directory, not the project's build directory, so that
for any number of projects my "build" directory would hold only 100 MB.

I am used to doing this on a number of IDEs (I am working on WIndows :( ), but being new to ESP-IDF, I am having difficulties on where to find information about these options.

Thanks for any pointers, including to documentation I am supposed to read.
Julio

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

Re: Limiting compilation of all libraries

Postby ESP_igrr » Sat Oct 26, 2019 7:39 am

Hi Julio,

If you are using the CMake build system, you can set COMPONENTS variable to a short list of components you are actually using (see https://docs.espressif.com/projects/esp ... -variables). By default the main component implicitly "REQUIRE"s all other components, you can set an explicit list there as well, see the same documentation page.

With regards to sharing the build products, it is not possible in the general case, since compilation of every IDF project depends on the options set in sdkconfig file. Each project may have different settings in the sdkconfig files, so object files built with different projects will be exactly the same.

jcdmelo
Posts: 2
Joined: Fri Oct 25, 2019 11:44 am

Re: Limiting compilation of all libraries

Postby jcdmelo » Tue Oct 29, 2019 8:56 pm

Hi, ESP_igrr (sorry, didn't catch your name),

Thanks for the reply. I will look into the documentation to know how to set the COMPONENTS variable.

In your last phrase, I guess you meant "will NOT be exactly the same", right?

Regards,
Julio

Who is online

Users browsing this forum: No registered users and 131 guests