Page 1 of 1

How to an ESP32 library and reuse it on other projects

Posted: Mon Sep 25, 2017 7:48 pm
by jgfrmesp
Hi,

Currently, I build a library that can be used to configure the esp32 using wifi.
What I want to do is to consider this library as a separate project (e.g. in terms of git) and include it in other projects (since most of my projects need some way to configure the esp32.

My questions are twofold:
1) how can I build an esp32 library with esp-idf build system
2) how can I include the resulting library in another esp32 project.

Thanks.
-- Jaap

Re: How to an ESP32 library and reuse it on other projects

Posted: Tue Sep 26, 2017 1:24 am
by ESP_Angus
Hi Jaap,

The build system docs should explain everything you need to know for this:
https://esp-idf.readthedocs.io/en/lates ... ystem.html

Short version is:
  • Create a component for your library.
  • Put the component in the "components" directory of your project (maybe as a git submodule), or put it somewhere else and set EXTRA_COMPONENT_DIRS in your project Makefile to pick it up.
Please let us know if there's anything that isn't explained adequately in the docs.

Angus