CMake: check GNU compiler before using extension

Minor edit, don't assume non-msvc compilers are gcc/gnu compatible.
This commit is contained in:
Campbell Barton 2015-11-23 08:31:29 +11:00
parent 4ff0126e89
commit b9e0fe2003
1 changed files with 2 additions and 3 deletions

View File

@ -2768,9 +2768,8 @@ if(WITH_CPP11)
endif()
endif()
if(MSVC)
# Visual Studio has all standards it supports available by default
else()
# Visual Studio has all standards it supports available by default
if(CMAKE_COMPILER_IS_GNUCC)
# Use C99 + GNU extensions, works with GCC, Clang, ICC
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
endif()