Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP32: Optimize the temperature-measurement-app for CMake #6397

Merged
merged 1 commit into from
May 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions config/esp32/components/chip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,19 @@ macro(chip_gn_arg_append arg val)
string(APPEND chip_gn_args "${arg} = ${val}\n")
endmacro()

macro(chip_gn_arg_bool arg boolean)
if (${boolean})
string(APPEND chip_gn_args "${arg} = true\n")
else()
string(APPEND chip_gn_args "${arg} = false\n")
endif()
endmacro()

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)

if(CONFIG_ENABLE_PW_RPC)
chip_gn_arg_append("chip_build_pw_rpc_lib" "true")
Expand Down
6 changes: 6 additions & 0 deletions examples/temperature-measurement-app/esp32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
# The following lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)

set(is_debug true CACHE BOOL "Optimization variable")
if(NOT is_debug)
set(SDKCONFIG_DEFAULTS "sdkconfig.optimize.defaults")
endif()

include($ENV{IDF_PATH}/tools/cmake/project.cmake)

# The list of extra component dirs must be in sync with that in temperature-measurement-app/esp32/Makefile
Expand Down
2 changes: 1 addition & 1 deletion examples/temperature-measurement-app/esp32/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,5 @@ Optimization related to WiFi, BLuetooth, Asserts etc are the part of this
example by default. To enable this option set is_debug=false from command-line.

```
idf make build flash monitor 'is_debug=false'
idf.py -Dis_debug=false build flash monitor
```