Skip to content

Commit

Permalink
Fix shared builds
Browse files Browse the repository at this point in the history
  • Loading branch information
dantti committed Jun 22, 2022
1 parent d2198a8 commit 6d1667f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions QXlsx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion QXlsx/QXlsx.pri
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 3 additions & 1 deletion QXlsx/header/xlsxglobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6d1667f

Please sign in to comment.