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()