From e94ce31a6470c090e7380511ce643fe213249839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joel=20H=C3=B6ner?= Date: Wed, 20 Apr 2022 11:22:32 +0200 Subject: [PATCH] Don't enable C11 for MSVC --- cmake/zyan-functions.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmake/zyan-functions.cmake b/cmake/zyan-functions.cmake index 5dcc947..5faf548 100644 --- a/cmake/zyan-functions.cmake +++ b/cmake/zyan-functions.cmake @@ -3,7 +3,14 @@ # =============================================================================================== # function (zyan_set_common_flags target) - set_target_properties("${target}" PROPERTIES C_STANDARD 11) + if (MSVC) + # MSVC support for C11 is still pretty lacking, so we instead just disable the warnings + # about using non-standard C extensions. + target_compile_options("${target}" PUBLIC "/wd4201") + else () + # For the more civilized compilers, we go with C11. + set_target_properties("${target}" PROPERTIES C_STANDARD 11) + endif () if (ZYAN_DEV_MODE) # If in developer mode, be pedantic.