Skip to content

Commit

Permalink
[Backport release-3_22] [o2] fix static linking on windows (#46064)
Browse files Browse the repository at this point in the history
* [o2] fix static linking on windows

pipacs/o2@1f9604e

* Weird char fixup

Co-authored-by: Matthias Kuhn <matthias@opengis.ch>
  • Loading branch information
qgis-bot and m-kuhn committed Nov 16, 2021
1 parent 8bad5fc commit 1a5f304
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions external/o2/src/CMakeLists.txt
Expand Up @@ -192,6 +192,10 @@ endif(BUILD_SHARED_LIBS AND APPLE AND POLICY CMP0042)

add_library( o2 ${o2_SRCS} ${o2_HDRS} )

if(BUILD_SHARED_LIBS)
add_definitions( -DO2_SHARED_LIB )
endif(BUILD_SHARED_LIBS)

if(o2_WITH_QT5)
target_link_libraries( o2 Qt5::Core Qt5::Network ${LINK_TARGETS})
else(o2_WITH_QT5)
Expand Down
4 changes: 2 additions & 2 deletions external/o2/src/o0export.h
@@ -1,12 +1,12 @@
#pragma once

// For exporting symbols from Windows' DLLs
#ifdef _WIN32
#if defined (_WIN32) && defined(O2_SHARED_LIB)
#ifdef O2_DLL_EXPORT
#define O0_EXPORT __declspec(dllexport)
#else
#define O0_EXPORT __declspec(dllimport)
#endif
#else
#define O0_EXPORT
#endif
#endif

0 comments on commit 1a5f304

Please sign in to comment.