void-packages/srcpkgs/chromium/patches/build-add-use_cxx17.patch

27 lines
931 B
Diff

--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -167,6 +167,10 @@
# Enable -H, which prints the include tree during compilation.
# For use by tools/clang/scripts/analyze_includes.py
show_includes = false
+
+ # Allow projects that wish to stay on C++17 to override Chromium's default.
+ # TODO(crbug.com/1402249): evaluate removing this end of 2023
+ use_cxx17 = false
}
declare_args() {
@@ -596,7 +600,11 @@
} else if (is_linux) {
# TODO(crbug.com/1284275): Switch to C++20 on all platforms.
if (is_clang) {
- cflags_cc += [ "-std=${standard_prefix}++20" ]
+ if (use_cxx17) {
+ cflags_cc += [ "-std=${standard_prefix}++17" ]
+ } else {
+ cflags_cc += [ "-std=${standard_prefix}++20" ]
+ }
} else {
# The gcc bots are currently using GCC 9, which is not new enough to
# support "c++20"/"gnu++20".