From 259c56993ea9f7ba2daf63329f962960dbc2964f Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Fri, 16 Oct 2026 00:40:42 +0200 Subject: [PATCH] cmake: require C 17 for the engine, native and Saigo-built games --- cmake/DaemonFlags.cmake | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/cmake/DaemonFlags.cmake b/cmake/DaemonFlags.cmake index 179835ddca..d4ba2a3e6e 100644 --- a/cmake/DaemonFlags.cmake +++ b/cmake/DaemonFlags.cmake @@ -350,9 +350,16 @@ else() # will complain about implicitly defined lseek, read, write and close. # GNU99 or later standard is required when building lua or lua will # complain that the compiler doesn't support 'long long'. - try_c_flag(GNU99 "-std=gnu99") - if (NOT FLAG_GNU99) - message(FATAL_ERROR "GNU99 is not supported by the compiler") + if (YOKAI_TARGET_SYSTEM_NACL AND NOT USE_NACL_SAIGO) + try_c_flag(GNU99 "-std=gnu99") + if (NOT FLAG_GNU99) + message(FATAL_ERROR "GNU99 is not supported by the compiler") + endif() + else() + try_c_flag(GNU17 "-std=gnu17") + if (NOT FLAG_GNU17) + message(FATAL_ERROR "GNU17 is not supported by the compiler") + endif() endif() endif()