- Commit
- 990aabe29415cdbc0d7fd22aa82c5e6bf31b4675
- Parent
- 6b999d990504d02206b20befbc5fbaea9b8e2306
- Author
- Nick Wellnhofer <wellnhofer@aevum.de>
- Date
Reintroduce version check for MSVC /TP flag
The flag is only required for old MSVC versions.
My personal build of CMark ✏️
Reintroduce version check for MSVC /TP flag
The flag is only required for old MSVC versions.
1 file changed, 4 insertions, 1 deletion
Status | File Name | N° Changes | Insertions | Deletions |
Modified | CMakeLists.txt | 5 | 4 | 1 |
diff --git 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>)