Skip to content

Commit 1298021

Browse files
gjc13pull[bot]
authored andcommitted
esp32: fix different NDEBUG definition in the examples and the library (#11775)
The debug level was not correctly synchronized between ESP-IDF and the connectedhomeip library.
1 parent 815f657 commit 1298021

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

config/esp32/components/chip/CMakeLists.txt

+11-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@ if (CONFIG_OPENTHREAD_ENABLED)
3939
list(APPEND CHIP_REQURIE_COMPONENTS openthread)
4040
endif()
4141

42+
if (NOT CMAKE_BUILD_EARLY_EXPANSION)
43+
if (CONFIG_COMPILER_OPTIMIZATION_DEFAULT OR CONFIG_COMPILER_OPTIMIZATION_NONE)
44+
set(is_debug TRUE)
45+
else()
46+
if (NOT CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE)
47+
message(FATAL_ERROR "CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE shall be set")
48+
endif()
49+
endif()
50+
endif()
51+
4252
idf_component_register(SRCS chip.c chip.cpp
4353
PRIV_REQUIRES ${CHIP_REQURIE_COMPONENTS})
4454

@@ -62,7 +72,7 @@ chip_gn_arg_append("esp32_ar" "\"${CMAKE_AR}\"")
6272
chip_gn_arg_append("esp32_cc" "\"${CMAKE_C_COMPILER}\"")
6373
chip_gn_arg_append("esp32_cxx" "\"${CMAKE_CXX_COMPILER}\"")
6474
chip_gn_arg_append("esp32_cpu" "\"esp32\"")
65-
chip_gn_arg_bool("is_debug" is_debug)
75+
chip_gn_arg_bool("is_debug" ${is_debug})
6676

6777
if(CONFIG_BT_ENABLED)
6878
chip_gn_arg_append("chip_config_network_layer_ble" "true")

0 commit comments

Comments
 (0)