Parrallel compiling with CMake

o.copleston
Posts: 3
Joined: Fri Aug 09, 2019 7:02 pm

Parrallel compiling with CMake

Postby o.copleston » Fri Sep 20, 2019 10:43 am

With the old GNU Make build system, compiling my projects with

Code: Select all

make -j8
would drastically reduce my build time from minutes to seconds. How can I do this with the idf.py CMake build system?

MindReader32
Posts: 23
Joined: Mon May 14, 2018 8:33 am

Re: Parrallel compiling with CMake

Postby MindReader32 » Thu Oct 10, 2019 6:44 am

Hi,

I'd also like to know too please.

Thanks

ESP_renz
Posts: 7
Joined: Tue May 14, 2019 2:41 am

Re: Parrallel compiling with CMake

Postby ESP_renz » Thu Oct 10, 2019 8:08 am

CMake automatically does parallel builds.

Even faster build times can be achieved by using ccache. This can be done by:

1. passing argument `--ccache` to idf.py everytime you build
2. set CCACHE_ENABLE=1 before project() call in project CMakeLists.txt like so

Code: Select all

...
set(CCACHE_ENABLE 1)
project(...)
You need to have ccache installed on your system, however.

MindReader32
Posts: 23
Joined: Mon May 14, 2018 8:33 am

Re: Parrallel compiling with CMake

Postby MindReader32 » Sun Oct 13, 2019 10:04 am

cool, thanks, ccache is working a treat on macOS using homebrew.

Who is online

Users browsing this forum: Baidu [Spider], ESP_igrr, Google [Bot], Majestic-12 [Bot] and 16 guests