fix(espidf): drop CONFIGURE_DEPENDS from main/ glob — script-mode incompat

ESP-IDF runs component_get_requirements.cmake in script mode (not full
project mode) to scan component dependencies before the build proper.
CMake rejects CONFIGURE_DEPENDS in script mode with:
  CONFIGURE_DEPENDS is invalid for script and find package modes.

The persistent build dir is already wiped + restored from the template
on every compile (espidf_compiler.py:220-222 + CMakeLists.txt patches),
so the glob is re-evaluated naturally on the next cmake configure — we
don't need CONFIGURE_DEPENDS to catch new files.

Pairs with 27c9a28 (glob fix) + 21791a8 (template main.cpp decouple).
This commit is contained in:
David Montero 2026-05-23 17:49:14 +02:00
parent 21791a8237
commit c7594c1dac
1 changed files with 8 additions and 4 deletions

View File

@ -29,10 +29,14 @@ if(DEFINED ENV{ARDUINO_ESP32_PATH})
# "main.cpp" the linker dies with "undefined reference to Foo::bar()" # "main.cpp" the linker dies with "undefined reference to Foo::bar()"
# for every symbol that lives in a helper .cpp. # for every symbol that lives in a helper .cpp.
# #
# CONFIGURE_DEPENDS makes CMake re-glob on every cmake run, which is # No CONFIGURE_DEPENDS ESP-IDF's component_get_requirements.cmake
# what we want the persistent build dir is reused across compiles # evaluates each component's CMakeLists in script mode where
# and the file set changes per sketch. # CONFIGURE_DEPENDS isn't supported, and the build aborts with
file(GLOB _user_srcs CONFIGURE_DEPENDS # "CONFIGURE_DEPENDS is invalid for script and find package modes".
# We don't need it anyway: espidf_compiler wipes + restores main/
# from the template on every compile (touching CMakeLists.txt's
# mtime), so cmake re-globs naturally on the next configure run.
file(GLOB _user_srcs
"${CMAKE_CURRENT_LIST_DIR}/*.cpp" "${CMAKE_CURRENT_LIST_DIR}/*.cpp"
"${CMAKE_CURRENT_LIST_DIR}/*.c") "${CMAKE_CURRENT_LIST_DIR}/*.c")