Skip to content

Commit 0d74c50

Browse files
authored
Merge pull request #2931 from ferdnyc:wechat-iconv-fix
Link wechat_qrcode with libiconv on MinGW * wechat_qrcode: explicit iconv dependency Iconv isn't automatic on all systems, non-POSIX have a separate libiconv that needs to be found in CMake and linked. * Don't disable iconv on MinGW * wechat_qrcode: Disable iconv if not found
1 parent ff9b0a1 commit 0d74c50

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

modules/wechat_qrcode/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
set(the_description "WeChat QR code Detector")
22
ocv_define_module(wechat_qrcode opencv_core opencv_imgproc opencv_dnn WRAP java objc python js)
33

4+
# iconv support isn't automatic on some systems
5+
if(CMAKE_VERSION VERSION_GREATER "3.11")
6+
find_package(Iconv QUIET)
7+
if(Iconv_FOUND)
8+
ocv_target_link_libraries(${the_module} Iconv::Iconv)
9+
else()
10+
ocv_target_compile_definitions(${the_module} PRIVATE "NO_ICONV=1")
11+
endif()
12+
endif()
13+
414
# need to change
515
set(wechat_qrcode_commit_hash "a8b69ccc738421293254aec5ddb38bd523503252")
616
set(hash_detect_caffemodel "238e2b2d6f3c18d6c3a30de0c31e23cf")

modules/wechat_qrcode/src/zxing/zxing.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#define USE_ONED_WRITER 1
2828
#endif
2929

30-
#if defined(__ANDROID_API__) || defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__)
30+
#if defined(__ANDROID_API__) || defined(_MSC_VER)
3131

3232
#ifndef NO_ICONV
3333
#define NO_ICONV

0 commit comments

Comments
 (0)