1
0
mirror of https://github.com/QtExcel/QXlsx.git synced 2025-01-30 05:02:52 +08:00

Fix shared builds

This commit is contained in:
Daniel Nicoletti 2022-06-22 10:05:50 -03:00
parent d2198a84ef
commit 6d1667f55c
3 changed files with 7 additions and 2 deletions

View File

@ -148,6 +148,9 @@ add_library(QXlsx
)
add_library(QXlsx::QXlsx ALIAS QXlsx)
if (BUILD_SHARED_LIBS)
target_compile_definitions(QXlsx PUBLIC QXlsx_SHAREDLIB)
endif()
target_link_libraries(${PROJECT_NAME}
Qt${QT_VERSION_MAJOR}::Core

View File

@ -15,7 +15,7 @@ CONFIG += c++11
DEFINES += QT_DEPRECATED_WARNINGS
# For DLL visibility
#DEFINES += QXlsx_EXPORTS
#DEFINES += QXlsx_SHAREDLIB QXlsx_EXPORTS
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.

View File

@ -16,10 +16,12 @@
#include <QStringList>
#include <QSharedPointer>
#if defined(QXlsx_SHAREDLIB)
#if defined(QXlsx_EXPORTS)
# define QXLSX_EXPORT Q_DECL_EXPORT
#elif defined (QXlsx_IMPORTS)
#else
# define QXLSX_EXPORT Q_DECL_IMPORT
#endif
#else
# define QXLSX_EXPORT
#endif