From c718a5bee6a4edc074ad7c41c6270d8937ade75a Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Mon, 18 Nov 2024 11:58:06 -0500 Subject: [PATCH] Build sample apps using C++17 (see #3611) --- BUILD.gn | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/BUILD.gn b/BUILD.gn index 4679dd35e..d4a3962c4 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -1147,6 +1147,19 @@ config("libcef_dll_wrapper_config") { ldflags = [ "/STACK:0x800000" ] } } + + # Build using the minimum C++ version supported by the CEF binary distribution. + # Chromium (and libcef) may build with a newer C++ version so this helps to + # avoid accidental usage of new/unsupported language features in sample apps. + # For Chromium defaults see //build/config/compiler/BUILD.gn. + if (is_win) { + cflags_cc = [ "/std:c++17" ] + } else { + cflags_cc = [ "-std=c++17" ] + } + if (is_mac) { + cflags_objcc = [ "-std=c++17" ] + } } # libcef_dll_wrapper target.