build/cmake/DefinePlatformSpecifc.cmake: Ensure ClangCl on MSVC is recognized as MSVC (because it does not handle -Wall too well)
diff --git a/build/cmake/DefinePlatformSpecifc.cmake b/build/cmake/DefinePlatformSpecifc.cmake
index f43f503..84409e6 100644
--- a/build/cmake/DefinePlatformSpecifc.cmake
+++ b/build/cmake/DefinePlatformSpecifc.cmake
@@ -25,13 +25,7 @@
# basic options
foreach(lang IN ITEMS C CXX)
- if(CMAKE_${lang}_COMPILER_ID STREQUAL "Clang")
- set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} -Wall")
- set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} -ferror-limit=1")
- elseif(CMAKE_${lang}_COMPILER_ID STREQUAL "GNU")
- set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} -Wall -Wextra")
- set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} -fmax-errors=1")
- elseif(CMAKE_${lang}_COMPILER_ID STREQUAL "MSVC")
+ if("CMAKE_${lang}_COMPILER_ID" STREQUAL "MSVC" OR "${CMAKE_${lang}_SIMULATE_ID}" STREQUAL "MSVC")
set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} /MP") # parallel build
set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} /W3") # warning level 3
include(CheckCXXCompilerFlag)
@@ -45,6 +39,12 @@
set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} /execution-charset:utf-8")
endif()
add_definitions("-DUNICODE -D_UNICODE")
+ elseif("CMAKE_${lang}_COMPILER_ID" STREQUAL "Clang")
+ set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} -Wall")
+ set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} -ferror-limit=1")
+ elseif("CMAKE_${lang}_COMPILER_ID" STREQUAL "GNU")
+ set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} -Wall -Wextra")
+ set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} -fmax-errors=1")
endif()
endforeach()