Merge pull request #2171 from uazo/fix-clangd-build

Add kill switch for no-unqualified-std-cast-call build option
This commit is contained in:
Carl 2022-07-13 22:40:20 +02:00 committed by GitHub
commit ddb789ed0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,54 @@
From: uazo <uazo@users.noreply.github.com>
Date: Wed, 13 Jul 2022 09:45:07 +0000
Subject: Add kill switch for no-unqualified-std-cast-call
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 | 8 ++++++--
build_overrides/build.gni | 3 +++
2 files changed, 9 insertions(+), 2 deletions(-)
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
@@ -1531,7 +1531,7 @@ config("default_warnings") {
"-Wno-ignored-pragma-optimize",
]
- if (!is_nacl) {
+ if (!is_nacl && !skip_clangd_unsupported_options) {
# TODO(https://crbug.com/1300731) Clean up and enable.
cflags += [ "-Wno-unqualified-std-cast-call" ]
}
@@ -1541,8 +1541,12 @@ config("default_warnings") {
# TODO(https://crbug.com/1316298): Re-enable once test failure is figured out
cflags += [
"-Xclang",
- "-no-opaque-pointers",
]
+ if (!skip_clangd_unsupported_options) {
+ cflags += [
+ "-no-opaque-pointers",
+ ]
+ }
}
if (is_fuchsia) {
diff --git a/build_overrides/build.gni b/build_overrides/build.gni
--- a/build_overrides/build.gni
+++ b/build_overrides/build.gni
@@ -42,6 +42,9 @@ declare_args() {
# Allows googletest to pretty-print various absl types. Disabled for nacl due
# to lack of toolchain support.
gtest_enable_absl_printers = !is_nacl
+
+ # Allows clangd builds by suppressing unsupported parameters
+ skip_clangd_unsupported_options = false
}
# Allows different projects to specify their own suppression/ignore lists for
--
2.25.1