ESP-IDF: How to add custom compiler-flags
The recommended way of adding custom compiler flags to ESP-IDF projects is to add the following line to the end of main/CMakeLists.txt
. Note: Don’t add it to CMakeLists.txt
in the project root directory, but in the main/
subdirectory.
target_compile_options(${COMPONENT_LIB} PRIVATE -ffast-math)
Replace -ffast-math
with your desired compiler flags.
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow