Skip to content

Commit

Permalink
Fix link type mismatch on Windows and build a shared library by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-osman committed Mar 22, 2018
1 parent f70405e commit 43f55df
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ set(PROJECT_VERSION_MINOR 0)
set(PROJECT_VERSION_PATCH 1)
set(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})

# Build a shared library by default
option(BUILD_SHARED_LIBS "Build QHttpEngine as a shared library" ON)

set(BIN_INSTALL_DIR bin CACHE STRING "Binary runtime installation directory relative to the install prefix")
set(LIB_INSTALL_DIR lib CACHE STRING "Library installation directory relative to the install prefix")
set(INCLUDE_INSTALL_DIR include CACHE STRING "Header installation directory relative to the install prefix")
Expand Down
8 changes: 5 additions & 3 deletions src/qhttpengine_export.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,16 @@
#define QHTTPENGINE_VERSION_PATCH @PROJECT_VERSION_PATCH@
#define QHTTPENGINE_VERSION "@PROJECT_VERSION@"

#if defined(QT_STATIC)
# define QHTTPENGINE_EXPORT
#else
#cmakedefine BUILD_SHARED_LIBS

#if defined(BUILD_SHARED_LIBS)
# if defined(QHTTPENGINE_LIBRARY)
# define QHTTPENGINE_EXPORT Q_DECL_EXPORT
# else
# define QHTTPENGINE_EXPORT Q_DECL_IMPORT
# endif
#else
# define QHTTPENGINE_EXPORT
#endif

#endif // QHTTPENGINE_QHTTPENGINE_H

0 comments on commit 43f55df

Please sign in to comment.