Added warnings-as-errors support for MSVC.
authorRoman Donchenko <roman.donchenko@itseez.com>
Thu, 22 Aug 2013 14:25:38 +0000 (18:25 +0400)
committerRoman Donchenko <roman.donchenko@itseez.com>
Thu, 22 Aug 2013 14:25:38 +0000 (18:25 +0400)
cmake/OpenCVCompilerOptions.cmake

index 4ba6469..8ead1a1 100644 (file)
@@ -239,6 +239,10 @@ if(MSVC)
       set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /fp:fast") # !! important - be on the same wave with x64 compilers
     endif()
   endif()
+
+  if(OPENCV_WARNINGS_ARE_ERRORS)
+    set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /WX")
+  endif()
 endif()
 
 # Extra link libs if the user selects building static libs: