Hi!
I have a library GitHub - Johboh/GCMEncryption.
This library is built and published for Arduino and ESP-IDF frameworks to PlatformIO registry (as well as Arduino IDE library manager and ESP Component Registry).
If I create platformIO project using framework=arduino
and add this library as a dependency (lib_deps = Johboh/GCMEncryption
), and using the example code for Arduino, it builds and links fine.
The root CMakeLists.txt is not used when added as a library, only as a component.
However, if I change the framework to espidf
(and uses the espidf example), I get linker errors with missing mbedtls. mbedtls is set as a required dependency here.
If I copy the files for the repo into a GCMEncryption folder under ./lib
, and remove the lib_deps = Johboh/GCMEncryption
dependency, it fails with the same linker issue.
If I add the files for the repo into a folder under ./components
instead, it builds and links fine.
So the question is, are libraries not the same as components, do I need to specify them differently in platformio.ini, or is the library itself configured wrongly?
My goal here is to be able to provide a library/component for users of PlatformIO and the ESP-IDF framework, and for them to be able to add it as a dependency in their platformio.ini, same as if they where using the Arduino framework.
Regards,
Johan