Skip to content
Permalink
Browse files
Merge pull request #46046 from m-kuhn/o2-static-windows
[o2] fix static linking on windows
  • Loading branch information
m-kuhn committed Nov 16, 2021
2 parents 7495f57 + 04c9e86 commit 4171f75b68291ee40acb6b9d0c5123db45470b29
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 4171f75

Please sign in to comment.