From c7ac60f3125e8f2d9ebe466180c0638d9d237744 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Sat, 3 Feb 2024 19:57:32 -0700 Subject: [PATCH] Require C11 This required silencing C5105 which emits warnings about system headers which we can't change. https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c5105?view=msvc-170 --- cmake/CompilerWarnings.cmake | 1 + cmake/Macros.cmake | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/CompilerWarnings.cmake b/cmake/CompilerWarnings.cmake index 1dc749f..77678b7 100644 --- a/cmake/CompilerWarnings.cmake +++ b/cmake/CompilerWarnings.cmake @@ -34,6 +34,7 @@ function(set_file_warnings) /wd4068 # disable warnings about unknown pragmas (e.g. #pragma GCC) /wd4505 # disable warnings about unused functions that might be platform-specific /wd4800 # disable warnings regarding implicit conversions to bool + /wd5105 # disable warning about expansion of 'defined' keyword ) set(CLANG_AND_GCC_WARNINGS diff --git a/cmake/Macros.cmake b/cmake/Macros.cmake index b5b01d5..68b27ca 100644 --- a/cmake/Macros.cmake +++ b/cmake/Macros.cmake @@ -19,8 +19,8 @@ macro(csfml_add_library target) # add warnings set_file_warnings(${THIS_SOURCES}) - # require C99 and C++17 - target_compile_features(${target} PUBLIC c_std_99 cxx_std_17) + # require C11 and C++17 + target_compile_features(${target} PUBLIC c_std_11 cxx_std_17) # define the export symbol of the module string(REPLACE "-" "_" NAME_UPPER "${target}")