From 80bb1d21903881e4061a41739d413a296ceb3b49 Mon Sep 17 00:00:00 2001 From: Igor Sirotin Date: Mon, 6 Feb 2023 18:02:08 +0300 Subject: [PATCH] Fixes for MacOS build with Qt5 --- examples/QZXingLive/application.cpp | 2 +- src/CMakeLists.txt | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/examples/QZXingLive/application.cpp b/examples/QZXingLive/application.cpp index 899b520..a4fda59 100644 --- a/examples/QZXingLive/application.cpp +++ b/examples/QZXingLive/application.cpp @@ -28,7 +28,7 @@ Application::Application() connect(this, &Application::onPermissionsDenied, this, &Application::initializeQML); -#if QT_VERSION < 0x060000 +#if defined(Q_OS_ANDROID) && QT_VERSION < 0x060000 NativeHelpers::registerApplicationInstance(this); #endif } diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 427ae19..f4f0bc7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -49,14 +49,10 @@ if(WIN32) if(MSVC) add_definitions(-D__STDC_LIMIT_MACROS) endif(MSVC) - +else() add_definitions(-DNO_ICONV) endif(WIN32) -if(ANDROID) - add_definitions(-DNO_ICONV) -endif() - if(VS_WINRT_COMPONENT) add_definitions(-DNO_ICONV) endif(VS_WINRT_COMPONENT)