From 3f72ff215e1eb21ea528b8c7066c5b18db61d8e5 Mon Sep 17 00:00:00 2001 From: Neil Shipp Date: Thu, 29 Jun 2017 17:56:09 -0700 Subject: [PATCH] Fix WinRT build breaks in highgui and videoio. --- modules/highgui/src/window.cpp | 2 +- modules/highgui/src/window_winrt_bridge.cpp | 2 ++ modules/videoio/CMakeLists.txt | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/highgui/src/window.cpp b/modules/highgui/src/window.cpp index 24686af6be..25cc030de7 100644 --- a/modules/highgui/src/window.cpp +++ b/modules/highgui/src/window.cpp @@ -218,7 +218,7 @@ int cv::waitKey(int delay) { CV_TRACE_FUNCTION(); int code = waitKeyEx(delay); -#ifndef HAVE_WINRT +#ifndef WINRT static int use_legacy = -1; if (use_legacy < 0) { diff --git a/modules/highgui/src/window_winrt_bridge.cpp b/modules/highgui/src/window_winrt_bridge.cpp index b107b1fcf3..13edbe5b83 100644 --- a/modules/highgui/src/window_winrt_bridge.cpp +++ b/modules/highgui/src/window_winrt_bridge.cpp @@ -24,6 +24,8 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. +#include "precomp.hpp" + #include "opencv2\highgui\highgui_winrt.hpp" #include "window_winrt_bridge.hpp" diff --git a/modules/videoio/CMakeLists.txt b/modules/videoio/CMakeLists.txt index 89a375781e..086e2235e5 100644 --- a/modules/videoio/CMakeLists.txt +++ b/modules/videoio/CMakeLists.txt @@ -256,6 +256,9 @@ endif() if(MSVC) set_target_properties(${the_module} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:atlthunk.lib /NODEFAULTLIB:atlsd.lib /NODEFAULTLIB:libcmt.lib /DEBUG") + if(DEFINED WINRT AND NOT DEFINED ENABLE_WINRT_MODE_NATIVE) + set_target_properties(${the_module} PROPERTIES VS_DESKTOP_EXTENSIONS_VERSION "${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}") + endif() endif() #stop automatic dependencies propagation for this module