From b9e0fe20034e355809a260b5adba52889f325b8e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 23 Nov 2015 08:31:29 +1100 Subject: CMake: check GNU compiler before using extension Minor edit, don't assume non-msvc compilers are gcc/gnu compatible. --- CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index b5317ccb724..7319a34d11b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() -- cgit v1.2.3