From af98c75f1ad3338c813aa475aa1b543dd80c138a Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Sat, 12 Mar 2016 11:51:51 +0100 Subject: 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. --- src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/CMakeLists.txt') 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() -- cgit v1.2.3