diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-11-23 00:31:29 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-11-23 00:31:29 +0300 |
commit | b9e0fe20034e355809a260b5adba52889f325b8e (patch) | |
tree | a81ee073e29671a49a2f0638c88366ca9542e7e6 | |
parent | 4ff0126e890cebe16b4eec5c1b2bc507346b4f24 (diff) |
CMake: check GNU compiler before using extension
Minor edit, don't assume non-msvc compilers are gcc/gnu compatible.
-rw-r--r-- | CMakeLists.txt | 5 |
1 files changed, 2 insertions, 3 deletions
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() |