Przeglądaj źródła

Fix compiler flags for MSVC

Alexey Edelev 5 lat temu
rodzic
commit
03cd58830c
1 zmienionych plików z 5 dodań i 1 usunięć
  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)