Fix warnings-as-errors flag on MSVC
authorTuro Lamminen <turotl@gmail.com>
Mon, 2 Oct 2017 08:40:57 +0000 (11:40 +0300)
committerTuro Lamminen <turotl@gmail.com>
Mon, 2 Oct 2017 08:40:57 +0000 (11:40 +0300)
CMakeLists.txt

index bd5c861..ba219a4 100644 (file)
@@ -219,8 +219,12 @@ if (ASSIMP_COVERALLS)
 endif()
 
 if (ASSIMP_WERROR)
+  IF (MSVC)
+    add_compile_options(/WX)
+  ELSE()
     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
+  ENDIF()
 endif()
 
 INCLUDE (FindPkgMacros)