From 4251248ae6240e9fcbe8c7893ae9a7b5cb01c87e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=B3r=C3=A1nt=20Pint=C3=A9r?= Date: Sat, 12 Oct 2024 19:47:11 +0200 Subject: [PATCH] Track UD_DEBUG as a CMake input --- CMakeLists.txt | 11 ++++++++++- main/CMakeLists.txt | 3 --- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fb9c1ce8..753e81c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,8 +9,17 @@ if(UD_GEN STREQUAL "") endif() string(TOLOWER "${UD_GEN}" UD_GEN_LOWER) -# Make sure we reconfigure if UD_GEN changes +if(NOT DEFINED UD_DEBUG) + set(UD_DEBUG "$ENV{UD_DEBUG}") +endif() +if(UD_DEBUG STREQUAL "") + message("UD_DEBUG is not set, assuming 0.") + set(UD_GEN 0) +endif() + +# Make sure we reconfigure if UD_GEN and UD_DEBUG changes set_property(GLOBAL PROPERTY UD_GEN_TRACKER "${UD_GEN}") +set_property(GLOBAL PROPERTY UD_DEBUG_TRACKER "${UD_DEBUG}") if(UD_GEN STREQUAL "MK4") if (NOT "$ENV{IDF_TARGET}" STREQUAL "esp32s2") diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index b1283d51..db9f4bb0 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -9,9 +9,6 @@ idf_component_register( add_compile_definitions("${UD_GEN}") add_compile_definitions(FARMHUB_REPORT_MEMORY) -if(NOT DEFINED UD_DEBUG) - set(UD_DEBUG "$ENV{UD_DEBUG}") -endif() if(UD_DEBUG) add_compile_definitions(FARMHUB_DEBUG) add_compile_definitions(DUMP_MQTT)