From 3fd2384b81283fcab8cfb3f64e468351fc6e84a7 Mon Sep 17 00:00:00 2001 From: Maksim Shabunin Date: Thu, 22 Feb 2018 13:19:44 +0300 Subject: [PATCH] Fixed mingw compilation on Windows --- cmake/OpenCVPCHSupport.cmake | 2 +- modules/core/src/utils/filesystem.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/OpenCVPCHSupport.cmake b/cmake/OpenCVPCHSupport.cmake index 7c8437eb80..78071d10c1 100644 --- a/cmake/OpenCVPCHSupport.cmake +++ b/cmake/OpenCVPCHSupport.cmake @@ -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) diff --git a/modules/core/src/utils/filesystem.cpp b/modules/core/src/utils/filesystem.cpp index bba782fdbb..1aa0d3d0f8 100644 --- a/modules/core/src/utils/filesystem.cpp +++ b/modules/core/src/utils/filesystem.cpp @@ -25,6 +25,7 @@ #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN +#undef NOMINMAX #define NOMINMAX #include #include