esp-idf-template icon indicating copy to clipboard operation
esp-idf-template copied to clipboard

Build optimization flags should use CONFIG_COMPILER_OPTIMIZATION_* instead of CMAKE_BUILD_TYPE

Open georgik opened this issue 2 years ago • 1 comments
trafficstars

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: https://github.com/espressif/esp-idf/issues/4189

georgik avatar Oct 23 '23 12:10 georgik

@georgik Would you mind opening a PR for that?

ivmarkov avatar Oct 31 '23 19:10 ivmarkov