From 1978592023ada86f783a15887fb89dbf76c237ce Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Sat, 2 Dec 2023 00:07:01 +0530 Subject: [PATCH] [ESP32] Fix adding NDEBUG flag to CPPFLAGS (#30763) In esp-idf, NDEBUG flag is added to CPPFLAGS only if assertions are disabled. Making this inline to that. --- config/esp32/components/chip/CMakeLists.txt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/config/esp32/components/chip/CMakeLists.txt b/config/esp32/components/chip/CMakeLists.txt index b2058fe75df41c..e32588db436e2c 100644 --- a/config/esp32/components/chip/CMakeLists.txt +++ b/config/esp32/components/chip/CMakeLists.txt @@ -38,12 +38,9 @@ if(NOT "${IDF_TARGET}" STREQUAL "esp32h2") endif() if (NOT CMAKE_BUILD_EARLY_EXPANSION) - if (CONFIG_COMPILER_OPTIMIZATION_DEFAULT OR CONFIG_COMPILER_OPTIMIZATION_NONE) + if (CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE) set(is_debug TRUE) else() - if (NOT CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE) - message(FATAL_ERROR "CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE shall be set") - endif() set(is_debug FALSE) endif() endif()