From 2aef83ddcdd3317c3191e79c3be3fc06969f7768 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 27 Aug 2019 20:28:42 -0500 Subject: [PATCH] Add a PlatformIO hook to alter CXXFLAGS --- .../share/PlatformIO/scripts/common-cxxflags.py | 12 ++++++++++++ platformio.ini | 2 ++ 2 files changed, 14 insertions(+) create mode 100644 buildroot/share/PlatformIO/scripts/common-cxxflags.py diff --git a/buildroot/share/PlatformIO/scripts/common-cxxflags.py b/buildroot/share/PlatformIO/scripts/common-cxxflags.py new file mode 100644 index 000000000..3e75434ee --- /dev/null +++ b/buildroot/share/PlatformIO/scripts/common-cxxflags.py @@ -0,0 +1,12 @@ +# +# common-cxxflags.py +# Convenience script to apply customizations to CPP flags +# +Import("env") +env.Append(CXXFLAGS=[ + "-Wno-register" + #"-Wno-incompatible-pointer-types", + #"-Wno-unused-const-variable", + #"-Wno-maybe-uninitialized", + #"-Wno-sign-compare" +]) diff --git a/platformio.ini b/platformio.ini index ce49569df..6a35733c8 100644 --- a/platformio.ini +++ b/platformio.ini @@ -22,6 +22,7 @@ default_envs = megaatmega2560 [common] default_src_filter = + - - + +extra_scripts = pre:buildroot/share/PlatformIO/scripts/common-cxxflags.py build_flags = -fmax-errors=5 -g -ggdb @@ -590,6 +591,7 @@ platform = atmelsam board = adafruit_grandcentral_m4 framework = arduino build_flags = ${common.build_flags} -std=gnu++17 +extra_scripts = ${common.extra_scripts} build_unflags = -std=gnu++11 lib_deps = ${common.lib_deps} lib_ignore = U8glib-HAL