summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2016-03-12 11:51:51 +0100
committerNick Wellnhofer <wellnhofer@aevum.de>2016-03-12 11:51:51 +0100
commitaf98c75f1ad3338c813aa475aa1b543dd80c138a (patch)
tree6724e3dbf909f022095cb5a7ad669c15477dfb78 /src
parent6135e9b953747365358f7f2e23e53cc0e4a701b2 (diff)
Compile in plain C mode with MSVC 12.0 or newer
Under MSVC, we used to compile in C++ mode to get some C99 features like mixing declarations and code. With newer MSVC versions, it's possible to build in plain C mode.
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 386bfe8..2de501a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -169,8 +169,8 @@ elseif(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -std=c99 -pedantic")
endif()
-# Compile as C++ under MSVC
-if(MSVC)
+# Compile as C++ under MSVC older than 12.0
+if(MSVC AND MSVC_VERSION LESS 1800)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /TP")
endif()