浏览代码

Add a PlatformIO hook to alter CXXFLAGS

Scott Lahteine 5 年前
父节点
当前提交
2aef83ddcd
共有 2 个文件被更改,包括 14 次插入0 次删除
  1. 12
    0
      buildroot/share/PlatformIO/scripts/common-cxxflags.py
  2. 2
    0
      platformio.ini

+ 12
- 0
buildroot/share/PlatformIO/scripts/common-cxxflags.py 查看文件

@@ -0,0 +1,12 @@
1
+#
2
+# common-cxxflags.py
3
+# Convenience script to apply customizations to CPP flags
4
+#
5
+Import("env")
6
+env.Append(CXXFLAGS=[
7
+  "-Wno-register"
8
+  #"-Wno-incompatible-pointer-types",
9
+  #"-Wno-unused-const-variable",
10
+  #"-Wno-maybe-uninitialized",
11
+  #"-Wno-sign-compare"
12
+])

+ 2
- 0
platformio.ini 查看文件

@@ -22,6 +22,7 @@ default_envs = megaatmega2560
22 22
 
23 23
 [common]
24 24
 default_src_filter = +<src/*> -<src/config> -<src/HAL> +<src/HAL/shared>
25
+extra_scripts = pre:buildroot/share/PlatformIO/scripts/common-cxxflags.py
25 26
 build_flags = -fmax-errors=5
26 27
   -g
27 28
   -ggdb
@@ -590,6 +591,7 @@ platform      = atmelsam
590 591
 board         = adafruit_grandcentral_m4
591 592
 framework     = arduino
592 593
 build_flags   = ${common.build_flags} -std=gnu++17
594
+extra_scripts = ${common.extra_scripts}
593 595
 build_unflags = -std=gnu++11
594 596
 lib_deps      = ${common.lib_deps}
595 597
 lib_ignore    = U8glib-HAL

正在加载...
取消
保存