Skip to content

Commit

Permalink
restore uwp patch
Browse files Browse the repository at this point in the history
  • Loading branch information
cenit committed May 2, 2020
1 parent b6dcbec commit d4650da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 47 deletions.
48 changes: 2 additions & 46 deletions ports/opencv4/0009-fix-uwp.patch
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake
index 799592b..3f44173 100644
index 9053957..d2b6412 100644
--- a/cmake/OpenCVModule.cmake
+++ b/cmake/OpenCVModule.cmake
@@ -852,7 +852,7 @@ macro(ocv_create_module)
set(the_module_target ${the_module})
endif()

- if(WINRT)
+ if(WINRT AND BUILD_TESTS)
# removing APPCONTAINER from modules to run from console
# in case of usual starting of WinRT test apps output is missing
# so starting of console version w/o APPCONTAINER is required to get test results
@@ -1175,7 +1175,7 @@ function(ocv_add_perf_tests)
@@ -1196,7 +1196,7 @@ function(ocv_add_perf_tests)
set_target_properties(${the_target} PROPERTIES FOLDER "tests performance")
endif()

Expand All @@ -20,38 +11,3 @@ index 799592b..3f44173 100644
# removing APPCONTAINER from tests to run from console
# look for detailed description inside of ocv_create_module macro above
add_custom_command(TARGET "opencv_perf_${name}"
diff --git a/modules/core/src/utils/datafile.cpp b/modules/core/src/utils/datafile.cpp
index aafbfdf..10543ae 100644
--- a/modules/core/src/utils/datafile.cpp
+++ b/modules/core/src/utils/datafile.cpp
@@ -108,7 +108,7 @@ static cv::String getModuleLocation(const void* addr)
CV_UNUSED(addr);
#ifdef _WIN32
HMODULE m = 0;
-#if _WIN32_WINNT >= 0x0501
+#if _WIN32_WINNT >= 0x0501 && (!defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP))
::GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
reinterpret_cast<LPCTSTR>(addr),
&m);
@@ -155,7 +155,7 @@ bool getBinLocation(std::wstring& dst)
{
void* addr = (void*)getModuleLocation; // using code address, doesn't work with static linkage!
HMODULE m = 0;
-#if _WIN32_WINNT >= 0x0501
+#if _WIN32_WINNT >= 0x0501 && (!defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP))
::GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
reinterpret_cast<LPCTSTR>(addr),
&m);
diff --git a/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp b/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp
index 236e227..eccf97e 100644
--- a/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp
+++ b/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp
@@ -94,7 +94,7 @@ Media::CaptureFrameGrabber::~CaptureFrameGrabber()

void Media::CaptureFrameGrabber::ShowCameraSettings()
{
-#if WINAPI_FAMILY!=WINAPI_FAMILY_PHONE_APP
+#if (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP) && (WINAPI_FAMILY != WINAPI_FAMILY_PC_APP)
if (_state == State::Started)
{
CameraOptionsUI::Show(_capture.Get());
2 changes: 1 addition & 1 deletion ports/opencv4/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ vcpkg_from_github(
0002-install-options.patch
0003-force-package-requirements.patch
0004-fix-policy-CMP0057.patch
#0009-fix-uwp.patch
0009-fix-uwp.patch
)

string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" BUILD_WITH_STATIC_CRT)
Expand Down

0 comments on commit d4650da

Please sign in to comment.