Skip to content

Commit dbddf28

Browse files
Victor Hugo Vianna Silvacopybara-github
authored andcommitted
[build] Allow other repos to control use_cxx23 with build_overrides
At least Angle will have to stay on C++20 after Chromium migrates to C++23 [1], so give them an escape hatch. I'm hoping we can at least get rid of use_cxx17 to avoid having 2 flags [2]. [1] https://crbug.com/330910097#comment15 [2] https://groups.google.com/a/google.com/g/angle-team/c/_SeqZIlTyAQ Bug: 388070065 Change-Id: I5db734769953f71e51a1571964338a9d185b7a45 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7179482 Commit-Queue: Nico Weber <[email protected]> Reviewed-by: Nico Weber <[email protected]> Cr-Commit-Position: refs/heads/main@{#1548495} NOKEYCHECK=True GitOrigin-RevId: 79a63a62dad5cf0484983d94f83b0dcfc1f88283
1 parent e3b2ae8 commit dbddf28

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

config/compiler/compiler.gni

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,20 @@ declare_args() {
3232
# The default linker everywhere else.
3333
use_lld = is_clang && current_os != "zos"
3434

35-
# If false, build using C++20; otherwise, build using C++23.
36-
use_cxx23 = false
37-
3835
# If true, optimize for size.
3936
# Default to favoring speed over size for platforms not listed below.
4037
optimize_for_size =
4138
!is_high_end_android && (is_android || is_castos || is_fuchsia)
4239
}
4340

41+
# Allow other projects to keep use_cxx23 false by default if they aren't ready.
42+
if (!defined(use_cxx23)) {
43+
declare_args() {
44+
# If false, build using C++20; otherwise, build using C++23.
45+
use_cxx23 = false
46+
}
47+
}
48+
4449
declare_args() {
4550
# Default to warnings as errors for default workflow, where we catch
4651
# warnings with known toolchains. Allow overriding this e.g. for Chromium

0 commit comments

Comments
 (0)