velxio/backend/app/services/esp-idf-template
David Montero 27c9a2853d fix(espidf): glob all main/*.cpp /*.c so helper TUs link
Multi-file Arduino sketches (robot-desktop-eyes is the canonical
case) define classes and free functions in their own translation
units — Face::Update(), FaceExpression::GoTo_Surprised(),
AsyncTimer::SetIntervalMillis(...), etc. live in Face.cpp,
FaceExpression.cpp, AsyncTimer.cpp respectively.

The espidf_compiler drops every user-supplied .h/.cpp into
project/main/ but the main/CMakeLists.txt only declared
`SRCS "main.cpp"`, so the helper TUs never got compiled and the
linker died with dozens of "undefined reference to ..." entries.

Switch SRCS to a CONFIGURE_DEPENDS glob over the main/ directory
so every .cpp/.c that lands in main/ becomes part of the IDF main
component automatically. CONFIGURE_DEPENDS makes CMake re-evaluate
the glob on every reconfigure, which matters because the persistent
build dir is reused across compiles and the set of helper files
changes per sketch.

Repro: open robot-desktop-eyes, click Compile. Before this commit:
37 linker errors starting at "undefined reference to `u8g2'" and
"undefined reference to `Face::Update()`". After: the helper TUs
compile and the .elf links.
2026-05-23 17:30:29 +02:00
..
main fix(espidf): glob all main/*.cpp /*.c so helper TUs link 2026-05-23 17:30:29 +02:00
CMakeLists.txt
partitions.csv
sdkconfig.defaults fix(espidf): enable mbedTLS PSK so ssl_client.cpp links 2026-05-14 12:38:20 -03:00
sdkconfig.defaults.in feat(compile): ESP-IDF compile options + request dedup 2026-05-18 21:50:45 -03:00