Page 1 of 1

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

Posted: Sat Feb 19, 2022 4:06 pm
by gdanov
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.

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

Posted: Sun Feb 20, 2022 6:43 am
by ESP_Sprite
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.

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

Posted: Sun Feb 20, 2022 10:45 am
by gdanov
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)

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

Posted: Mon Feb 21, 2022 1:41 am
by ESP_Sprite
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.

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

Posted: Mon Feb 21, 2022 8:13 am
by gdanov
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.