From c7594c1dacd377728da100f9ab2bfad63302d91f Mon Sep 17 00:00:00 2001 From: David Montero Date: Sat, 23 May 2026 17:49:14 +0200 Subject: [PATCH] =?UTF-8?q?fix(espidf):=20drop=20CONFIGURE=5FDEPENDS=20fro?= =?UTF-8?q?m=20main/=20glob=20=E2=80=94=20script-mode=20incompat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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). --- .../services/esp-idf-template/main/CMakeLists.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/backend/app/services/esp-idf-template/main/CMakeLists.txt b/backend/app/services/esp-idf-template/main/CMakeLists.txt index 07537ed1..4107eaa6 100644 --- a/backend/app/services/esp-idf-template/main/CMakeLists.txt +++ b/backend/app/services/esp-idf-template/main/CMakeLists.txt @@ -29,10 +29,14 @@ if(DEFINED ENV{ARDUINO_ESP32_PATH}) # "main.cpp" the linker dies with "undefined reference to Foo::bar()" # for every symbol that lives in a helper .cpp. # - # CONFIGURE_DEPENDS makes CMake re-glob on every cmake run, which is - # what we want — the persistent build dir is reused across compiles - # and the file set changes per sketch. - file(GLOB _user_srcs CONFIGURE_DEPENDS + # No CONFIGURE_DEPENDS — ESP-IDF's component_get_requirements.cmake + # evaluates each component's CMakeLists in script mode where + # CONFIGURE_DEPENDS isn't supported, and the build aborts with + # "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}/*.c")