From 3435770c234862465328c5402dc7cf909f8f3a1f Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Tue, 7 May 2024 07:45:07 -0400 Subject: [PATCH] Meta: Use -std=c++2b on mac hosts in the GN build Xcode clang doesn't understand the -std=c++23 spelling yet, and this is what CMake's `set(CMAKE_CXX_STANDARD 23)` translates to too. Unbreaks building with Xcode clang on macOS. --- Meta/gn/build/BUILD.gn | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Meta/gn/build/BUILD.gn b/Meta/gn/build/BUILD.gn index 633488c5b32..9869e48e5d2 100644 --- a/Meta/gn/build/BUILD.gn +++ b/Meta/gn/build/BUILD.gn @@ -89,10 +89,15 @@ config("compiler_defaults") { if (use_lld) { ldflags += [ "-Wl,--color-diagnostics" ] } - cflags_cc += [ - "-std=c++23", - "-fvisibility-inlines-hidden", - ] + + if (current_os == "mac") { + # FIXME: Use -std=c++23 once Xcode's clang supports that. + cflags_cc += [ "-std=c++2b" ] + } else { + cflags_cc += [ "-std=c++23" ] + } + + cflags_cc += [ "-fvisibility-inlines-hidden" ] # Warning setup. cflags += [