summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2020-01-15 14:42:32 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2020-01-15 07:04:27 -0800
commit990aabe29415cdbc0d7fd22aa82c5e6bf31b4675 (patch)
treea8e94b05af33407dcf77795ac1ff6518e1857666
parent6b999d990504d02206b20befbc5fbaea9b8e2306 (diff)
Reintroduce version check for MSVC /TP flag
The flag is only required for old MSVC versions.
-rw-r--r--CMakeLists.txt5
1 files changed, 4 insertions, 1 deletions
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($<$<COMPILE_LANGUAGE:C>:/W4>)
add_compile_options($<$<COMPILE_LANGUAGE:C>:/wd4706>)
- add_compile_options($<$<COMPILE_LANGUAGE:C>:/TP>)
+ # Compile as C++ under MSVC older than 12.0
+ if(MSVC_VERSION LESS 1800)
+ add_compile_options($<$<COMPILE_LANGUAGE:C>:/TP>)
+ endif()
add_compile_options($<$<COMPILE_LANGUAGE:C>:/D_CRT_SECURE_NO_WARNINGS>)
elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES Clang)
add_compile_options($<$<COMPILE_LANGUAGE:C>:-Wall>)