Skip to content

Commit

Permalink
esp32: fix different NDEBUG definition in the examples and the library (
Browse files Browse the repository at this point in the history
#11775)

The debug level was not correctly synchronized between ESP-IDF and the
connectedhomeip library.
  • Loading branch information
gjc13 authored and pull[bot] committed Jan 4, 2023
1 parent 74452c3 commit 986029c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion config/esp32/components/chip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ if (CONFIG_OPENTHREAD_ENABLED)
list(APPEND CHIP_REQURIE_COMPONENTS openthread)
endif()

if (NOT CMAKE_BUILD_EARLY_EXPANSION)
if (CONFIG_COMPILER_OPTIMIZATION_DEFAULT OR CONFIG_COMPILER_OPTIMIZATION_NONE)
set(is_debug TRUE)
else()
if (NOT CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE)
message(FATAL_ERROR "CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE shall be set")
endif()
endif()
endif()

idf_component_register(SRCS chip.c chip.cpp
PRIV_REQUIRES ${CHIP_REQURIE_COMPONENTS})

Expand All @@ -62,7 +72,7 @@ chip_gn_arg_append("esp32_ar" "\"${CMAKE_AR}\"")
chip_gn_arg_append("esp32_cc" "\"${CMAKE_C_COMPILER}\"")
chip_gn_arg_append("esp32_cxx" "\"${CMAKE_CXX_COMPILER}\"")
chip_gn_arg_append("esp32_cpu" "\"esp32\"")
chip_gn_arg_bool("is_debug" is_debug)
chip_gn_arg_bool("is_debug" ${is_debug})

if(CONFIG_BT_ENABLED)
chip_gn_arg_append("chip_config_network_layer_ble" "true")
Expand Down

0 comments on commit 986029c

Please sign in to comment.