浏览代码

SCons: Only set GCC `-Wvirtual-inheritance` for C++ and `warnings=extra`

Rémi Verschelde 5 月之前
父节点
当前提交
a2f200c5d6
共有 1 个文件被更改,包括 2 次插入7 次删除
  1. 2 7
      SConstruct

+ 2 - 7
SConstruct

@@ -862,12 +862,7 @@ else:  # GCC, Clang
     common_warnings = []
 
     if methods.using_gcc(env):
-        common_warnings += [
-            "-Wshadow",
-            "-Wno-misleading-indentation",
-            # For optimized Object::cast_to / object.inherits_from()
-            "-Wvirtual-inheritance",
-        ]
+        common_warnings += ["-Wshadow", "-Wno-misleading-indentation"]
         if cc_version_major < 11:
             # Regression in GCC 9/10, spams so much in our variadic templates
             # that we need to outright disable it.
@@ -895,7 +890,7 @@ else:  # GCC, Clang
                     "-Wstringop-overflow=4",
                 ]
             )
-            env.Append(CXXFLAGS=["-Wplacement-new=1"])
+            env.Append(CXXFLAGS=["-Wplacement-new=1", "-Wvirtual-inheritance"])
             # Need to fix a warning with AudioServer lambdas before enabling.
             # if cc_version_major != 9:  # GCC 9 had a regression (GH-36325).
             #    env.Append(CXXFLAGS=["-Wnoexcept"])