From 6768820b5be9e117be0c386620a334a8c5f75f6c Mon Sep 17 00:00:00 2001 From: XMuli Date: Thu, 14 Jul 2022 22:07:26 +0800 Subject: [PATCH 1/2] fix: msvc and release is a build failure --- src/qtacrylichelper_global.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/qtacrylichelper_global.h b/src/qtacrylichelper_global.h index 9b973c5..47318c8 100644 --- a/src/qtacrylichelper_global.h +++ b/src/qtacrylichelper_global.h @@ -27,19 +27,19 @@ #include #ifndef QTACRYLICHELPER_API -#ifdef QTACRYLICHELPER_STATIC -#define QTACRYLICHELPER_API -#else -#ifdef QTACRYLICHELPER_BUILD_LIBRARY -#define QTACRYLICHELPER_API Q_DECL_EXPORT -#else -#define QTACRYLICHELPER_API Q_DECL_IMPORT -#endif -#endif + #ifdef QTACRYLICHELPER_STATIC + #define QTACRYLICHELPER_API + #else + #ifdef QTACRYLICHELPER_BUILD_LIBRARY + #define QTACRYLICHELPER_API Q_DECL_EXPORT + #else + #define QTACRYLICHELPER_API Q_DECL_EXPORT // Q_DECL_IMPORT + #endif + #endif #endif #if defined(Q_OS_WIN) && !defined(Q_OS_WINDOWS) -#define Q_OS_WINDOWS + #define Q_OS_WINDOWS #endif #ifndef Q_DISABLE_MOVE @@ -55,7 +55,7 @@ #endif #if (QT_VERSION < QT_VERSION_CHECK(5, 7, 0)) -#define qAsConst(i) std::as_const(i) + #define qAsConst(i) std::as_const(i) #endif namespace _qam::Global { From 411f713079cf8d11c075aa0f679aeee0f0a664d5 Mon Sep 17 00:00:00 2001 From: XMuli Date: Fri, 22 Jul 2022 00:34:56 +0800 Subject: [PATCH 2/2] build: Generate .dll by default --- src/CMakeLists.txt | 1 + src/qtacrylichelper_global.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9fb03e3..f4485f8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,6 +3,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) +set(BUILD_SHARED_LIBS ON) find_package(QT NAMES Qt6 Qt5 COMPONENTS Gui REQUIRED) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Gui REQUIRED) diff --git a/src/qtacrylichelper_global.h b/src/qtacrylichelper_global.h index 47318c8..27881b2 100644 --- a/src/qtacrylichelper_global.h +++ b/src/qtacrylichelper_global.h @@ -33,7 +33,7 @@ #ifdef QTACRYLICHELPER_BUILD_LIBRARY #define QTACRYLICHELPER_API Q_DECL_EXPORT #else - #define QTACRYLICHELPER_API Q_DECL_EXPORT // Q_DECL_IMPORT + #define QTACRYLICHELPER_API Q_DECL_IMPORT #endif #endif #endif