Add-kill-switch-for-no-unqualified-std-cast-call.patch 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. From: uazo <uazo@users.noreply.github.com>
  2. Date: Wed, 13 Jul 2022 09:45:07 +0000
  3. Subject: Add kill switch for no-unqualified-std-cast-call
  4. Allows build with clangd by suppressing unsupported parameters
  5. Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
  6. License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
  7. ---
  8. build/config/compiler/BUILD.gn | 8 ++++++--
  9. build_overrides/build.gni | 3 +++
  10. 2 files changed, 9 insertions(+), 2 deletions(-)
  11. diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
  12. --- a/build/config/compiler/BUILD.gn
  13. +++ b/build/config/compiler/BUILD.gn
  14. @@ -1531,7 +1531,7 @@ config("default_warnings") {
  15. "-Wno-ignored-pragma-optimize",
  16. ]
  17. - if (!is_nacl) {
  18. + if (!is_nacl && !skip_clangd_unsupported_options) {
  19. # TODO(https://crbug.com/1300731) Clean up and enable.
  20. cflags += [ "-Wno-unqualified-std-cast-call" ]
  21. }
  22. @@ -1541,8 +1541,12 @@ config("default_warnings") {
  23. # TODO(https://crbug.com/1316298): Re-enable once test failure is figured out
  24. cflags += [
  25. "-Xclang",
  26. - "-no-opaque-pointers",
  27. ]
  28. + if (!skip_clangd_unsupported_options) {
  29. + cflags += [
  30. + "-no-opaque-pointers",
  31. + ]
  32. + }
  33. }
  34. if (is_fuchsia) {
  35. diff --git a/build_overrides/build.gni b/build_overrides/build.gni
  36. --- a/build_overrides/build.gni
  37. +++ b/build_overrides/build.gni
  38. @@ -42,6 +42,9 @@ declare_args() {
  39. # Allows googletest to pretty-print various absl types. Disabled for nacl due
  40. # to lack of toolchain support.
  41. gtest_enable_absl_printers = !is_nacl
  42. +
  43. + # Allows clangd builds by suppressing unsupported parameters
  44. + skip_clangd_unsupported_options = false
  45. }
  46. # Allows different projects to specify their own suppression/ignore lists for
  47. --
  48. 2.25.1