Parcourir la source

Fix compiler flags for MSVC

Alexey Edelev il y a 5 ans
Parent
commit
03cd58830c
1 fichiers modifiés avec 5 ajouts et 1 suppressions
  1. 5 1
      CMakeLists.txt

+ 5 - 1
CMakeLists.txt

@@ -46,7 +46,11 @@ if(UNIX)
       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror")
     endif()
 elseif(WIN32)
-    set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-Wall" "-Werror")
+    if (${CMAKE_CXX_COMPILER_ID} MATCHES "MSVC")
+        set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "/WX /W4")
+    else()
+        message(WARNING "Only MSVC compilers family is supported for build")
+    endif()
 endif()
 
 if(Qt5_POSITION_INDEPENDENT_CODE)