Skip to content
Permalink
Browse files
[Backport release-3_22] [o2] fix static linking on windows (#46064)
* [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 1a5f304e930ad6a17bd20d95c7e191d304caec6b
Showing with 6 additions and 2 deletions.
  1. +4 −0 external/o2/src/CMakeLists.txt
  2. +2 −2 external/o2/src/o0export.h
@@ -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)
@@ -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.