diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 74e6596de82..02aa3697d00 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1548,7 +1548,12 @@ else() endif() # Visual Studio has all standards it supports available by default -if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "Intel") +# Clang on windows copies this behavior and does not support these switches +if( + CMAKE_COMPILER_IS_GNUCC OR + (CMAKE_C_COMPILER_ID MATCHES "Clang" AND (NOT MSVC)) OR + (CMAKE_C_COMPILER_ID MATCHES "Intel") +) # Use C99 + GNU extensions, works with GCC, Clang, ICC if(WITH_C11) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11") |