From 990aabe29415cdbc0d7fd22aa82c5e6bf31b4675 Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Wed, 15 Jan 2020 14:42:32 +0100 Subject: Reintroduce version check for MSVC /TP flag The flag is only required for old MSVC versions. --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e9f733d..b3edd74 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,7 +33,10 @@ if(MSVC) # Force to always compile with W4 add_compile_options($<$:/W4>) add_compile_options($<$:/wd4706>) - add_compile_options($<$:/TP>) + # Compile as C++ under MSVC older than 12.0 + if(MSVC_VERSION LESS 1800) + add_compile_options($<$:/TP>) + endif() add_compile_options($<$:/D_CRT_SECURE_NO_WARNINGS>) elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES Clang) add_compile_options($<$:-Wall>) -- cgit v1.2.3