Explorar o código

Fix compiler flags for MSVC

Alexey Edelev %!s(int64=5) %!d(string=hai) anos
pai
achega
03cd58830c
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  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)