Fixed mingw compilation on Windows
authorMaksim Shabunin <maksim.shabunin@gmail.com>
Thu, 22 Feb 2018 10:19:44 +0000 (13:19 +0300)
committerMaksim Shabunin <maksim.shabunin@gmail.com>
Thu, 22 Feb 2018 14:11:18 +0000 (17:11 +0300)
cmake/OpenCVPCHSupport.cmake
modules/core/src/utils/filesystem.cpp

index 7c8437e..78071d1 100644 (file)
@@ -211,7 +211,7 @@ MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName _input _pch_output_to_use )
 
     GET_TARGET_PROPERTY(_sources ${_targetName} SOURCES)
     FOREACH(src ${_sources})
-      if(NOT "${src}" MATCHES "\\.mm$")
+      if(NOT "${src}" MATCHES "\\.mm$" AND NOT "${src}" MATCHES "\\.rc$")
         get_source_file_property(_flags "${src}" COMPILE_FLAGS)
         get_source_file_property(_flags2 "${src}" COMPILE_DEFINITIONS)
         if(NOT _flags AND NOT _flags2)
index bba782f..1aa0d3d 100644 (file)
@@ -25,6 +25,7 @@
 
 #ifdef _WIN32
 #define WIN32_LEAN_AND_MEAN
+#undef NOMINMAX
 #define NOMINMAX
 #include <windows.h>
 #include <direct.h>