Closed jdthorpe closed 1 year ago
2 days of frustration and then 30 seconds after posting my question, I think I found my answer: Platform specific code lives in the target/[platform]
directories, and the platform specific dependencies should be cloned in the usual place (e.g. target/esp32/app/components
for esp-idf
dependencies) and consumed in platform specific drivers ( such as targets/esp32/app/main/drivers/my-awesome-driver.cpp
), and the the drivers should be exposed to the application layer here. Whew...
I have a question regarding how to include 3rd party packages that depend on or are aware of esp-idf. Specifically, when I was trying to use two libraries that depend on (u8g2-hal-esp-idf) or are at least aware of (u8g2) the esp-idf build system, I couldn't find an approach where I could use them without having to re-write the 3rd party library code and CMakeLIst.txt files. Some things that I tried included:
target/esp32/app/components
which, in most esp32 projects "just works". This had the desired effect of compiling the 3rd party projects automatically, but their includes and object files couldn't be found when compilingeuphonium
for the esp32 in the usual way. Updatingeuphonium/CMakeLists.txt
with anadd_library()
,add_subdirectory()
and the like invariably caused the error described beloweuphonium/
directory and adding them withadd_subdirectory()
along with cspot and friends](https://github.com/feelfreelinux/euphonium/blob/master/euphonium/CMakeLists.txt#L11-L13) also resulted in the follownig.With each approach where I tried to make these third party libraries available caused the esp32 cspot component (
target/esp32/app/components/cspot
) to be imported twice, resulting in this error:and the error trace always pointed to either a call to
idf_componente_register()
orregister_component()
in the third party libraries'CMakeLists.txt
files.Ultimately I just re-wrote the the dependencies to not depend on the esp-idf build system or includes from the esp-idf framework, which was fairly unsatisfactory. Do you have a recommended approach for including 3rd party packages that depend on the esp-idf build system or framework?
Thanks! (and thanks for the awesome library!)