From 9c2180000a41f13983a7ef4c5ae81ed728cd669b Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Wed, 14 Oct 2026 08:08:20 +0200 Subject: [PATCH] cmake: require C++ 20 for the engine, native and Saigo-built games --- cmake/DaemonFlags.cmake | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/cmake/DaemonFlags.cmake b/cmake/DaemonFlags.cmake index 906ed93a8a..179835ddca 100644 --- a/cmake/DaemonFlags.cmake +++ b/cmake/DaemonFlags.cmake @@ -363,13 +363,23 @@ else() message(FATAL_ERROR "GNU++23 is not supported by the compiler") endif() else() - # PNaCl only defines isascii if __STRICT_ANSI__ is not defined, - # always prefer GNU dialect. - try_cxx_flag(GNUXX14 "-std=gnu++14") - if (NOT FLAG_GNUXX14) - try_cxx_flag(GNUXX1Y "-std=gnu++1y") - if (NOT FLAG_GNUXX1Y) - message(FATAL_ERROR "GNU++14 is not supported by the compiler") + if (YOKAI_TARGET_SYSTEM_NACL AND NOT USE_NACL_SAIGO) + # PNaCl only defines isascii if __STRICT_ANSI__ is not defined, + # always prefer GNU dialect. + try_cxx_flag(GNUXX14 "-std=gnu++14") + if (NOT FLAG_GNUXX14) + try_cxx_flag(GNUXX1Y "-std=gnu++1y") + if (NOT FLAG_GNUXX1Y) + message(FATAL_ERROR "GNU++14 is not supported by the compiler") + endif() + endif() + else() + try_cxx_flag(GNUXX20 "-std=gnu++20") + if (NOT FLAG_GNUXX20) + try_cxx_flag(GNUXX2Y "-std=gnu++2a") + if (NOT FLAG_GNUXX2Y) + message(FATAL_ERROR "GNU++20 is not supported by the compiler") + endif() endif() endif() endif()