Files
cromite/build/patches/Add-kill-switch-for-unsupported-clangd-flags.patch
T

56 lines
2.0 KiB
Diff

From: uazo <uazo@users.noreply.github.com>
Date: Thu, 20 Oct 2022 09:34:48 +0000
Subject: Add kill switch for unsupported clangd flags
Allows build with clangd by suppressing unsupported parameters
Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
---
build/config/compiler/BUILD.gn | 11 ++++++++++-
build_overrides/build.gni | 3 +++
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -1950,7 +1950,6 @@ config("default_warnings") {
# TODO(crbug.com/40284799): Fix and re-enable.
"-Wno-thread-safety-reference-return",
]
-
cflags_cc += [
# TODO(crbug.com/328490295): Fix and re-enable for C flags.
"-Wenum-compare-conditional",
@@ -1965,6 +1964,16 @@ config("default_warnings") {
# TODO(crbug.com/344680447): Fix and re-enable.
cflags_cc += [ "-Wno-missing-template-arg-list-after-template-kw" ]
}
+ if (skip_clangd_unsupported_options) {
+ cflags -= [
+ "-Wno-deprecated-builtins",
+ "-Wno-thread-safety-reference-return",
+ ]
+ cflags_cc -= [
+ "-Wno-c++11-narrowing-const-reference",
+ "-Wno-missing-template-arg-list-after-template-kw",
+ ]
+ }
}
# Some builders, such as Cronet, use a different version of Clang than
diff --git a/build_overrides/build.gni b/build_overrides/build.gni
--- a/build_overrides/build.gni
+++ b/build_overrides/build.gni
@@ -54,6 +54,9 @@ declare_args() {
# to lack of toolchain support.
gtest_enable_absl_printers = !is_nacl
+ # Allows clangd builds by suppressing unsupported parameters
+ skip_clangd_unsupported_options = false
+
# Allow projects that wish to stay on C++17 to override Chromium's default.
# TODO(crbug.com/40251117): evaluate removing this end of 2023
use_cxx17 = false
--