How to add compiler flags to PlatformIO project
In order to add compiler flags to your PlatformIO project, add the following line to your build config(s) in platformio.ini:
platformio_build_flags.cpp
build_flags = -std=gnu++17You can also use multiple lines:
platformio_build_flags_multi.cpp
build_flags =
-std=gnu++17
-ffast-mathFull platformio.ini example:
platformio.ini
[env:d1_mini]
platform = espressif8266
board = d1_mini
framework = arduino
monitor_speed = 115200
build_flags = -std=gnu++17Check out similar posts by category:
PlatformIO
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow