how to add Arduino as component using esp32-arduino-lib-builder?

gdanov
Posts: 9
Joined: Sat Feb 05, 2022 10:53 pm

how to add Arduino as component using esp32-arduino-lib-builder?

Postby gdanov » Sat Feb 19, 2022 4:06 pm

using the manual https://docs.espressif.com/projects/ard ... onent.html I get Arduino as component working and that's great. However I don't want to checkout the arduino git repo in each project or build it every time I touch the sdkconfig.

The manual says "For a simplified method, see lib-builder.", but I can't figure out how to use the results once I build this project.

I guess that section https://docs.espressif.com/projects/esp ... components applies, but my cmake and C knowledge is not enough to figure it out.

ESP_Sprite
Posts: 9591
Joined: Thu Nov 26, 2015 4:08 am

Re: how to add Arduino as component using esp32-arduino-lib-builder?

Postby ESP_Sprite » Sun Feb 20, 2022 6:43 am

For the 'checkout per dir', you could check out the Arduino stuff in one directory, and then for each project that uses it, add

Code: Select all

set(EXTRA_COMPONENT_DIRS /home/me/whereever/the/arduino/component/dir/is)
to CMakeLists.txt.

gdanov
Posts: 9
Joined: Sat Feb 05, 2022 10:53 pm

Re: how to add Arduino as component using esp32-arduino-lib-builder?

Postby gdanov » Sun Feb 20, 2022 10:45 am

Thanks, I'll give that a try.

What are my options to minimize re-compilations of the Arduino component? I'd like to re-build the arduino component only when I touch something relevant in the sdkconfig. I'm pretty fine with a manual process (e.g. configure, build, copy something somewhere)

ESP_Sprite
Posts: 9591
Joined: Thu Nov 26, 2015 4:08 am

Re: how to add Arduino as component using esp32-arduino-lib-builder?

Postby ESP_Sprite » Mon Feb 21, 2022 1:41 am

I don't think you can get around an entire rebuild when you touch the sdkconfig. If you leave the sdkconfig alone, the Arduino code should not be recompiled though.

gdanov
Posts: 9
Joined: Sat Feb 05, 2022 10:53 pm

Re: how to add Arduino as component using esp32-arduino-lib-builder?

Postby gdanov » Mon Feb 21, 2022 8:13 am

I could use it as pre-compiled lib. But still can't figure out where's the arduino.a or how to include it.

Using ccache btw and the speed-up is impressive.

Who is online

Users browsing this forum: No registered users and 50 guests