rename to skip_clangd_unsupported_options

This commit is contained in:
Carmelo Messina 2022-07-13 13:46:04 +02:00
parent 9a8759023c
commit 506d1a51b8
No known key found for this signature in database
GPG key ID: 968894BE688289FD

View file

@ -1,12 +1,15 @@
From: uazo <uazo@users.noreply.github.com>
Date: Wed, 6 Jul 2022 11:29:24 +0000
Date: Wed, 13 Jul 2022 09:45:07 +0000
Subject: Add kill switch for no-unqualified-std-cast-call
Adds a new gn flag to disable the no-unqualified-std-cast-call option during build since it is not compatible
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 | 2 +-
build_overrides/build.gni | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
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
@ -16,19 +19,34 @@ diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
]
- if (!is_nacl) {
+ if (!is_nacl && !compile_clangd_index) {
+ 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,8 @@ declare_args() {
@@ -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
+
+ compile_clangd_index = false
+ # Allows clangd builds by suppressing unsupported parameters
+ skip_clangd_unsupported_options = false
}
# Allows different projects to specify their own suppression/ignore lists for