esp-rs/esp-idf-template

Build optimization flags should use CONFIG_COMPILER_OPTIMIZATION_* instead of CMAKE_BUILD_TYPE

georgik opened this issue · 1 comments

Motivations

Current version of template is using CMAKE_BUILD_TYPE to determine Release/Debug build. Which will result in the command like this:

idf.py -DCMAKE_BUILD_TYPE=Debug build flash monitor

The template should use CONFIG_COMPILER_OPTIMIZATION_DEBUG, CONFIG_COMPILER_OPTIMIZATION_SIZE, CONFIG_COMPILER_OPTIMIZATION_PERF and so on.

Setting CMAKE_BUILD_TYPE in IDF is not a supported way of changing optimization level, more details: espressif/esp-idf#4189

@georgik Would you mind opening a PR for that?