Export static symbols when building ws with shared library (#370)

This commit is contained in:
Anton Ivlev
2022-03-19 21:41:40 +03:00
committed by GitHub
parent f7eb3688dd
commit a3d2fa4b7e
8 changed files with 79 additions and 34 deletions

View File

@ -99,6 +99,7 @@ set( IXWEBSOCKET_HEADERS
ixwebsocket/IXWebSocketCloseConstants.h
ixwebsocket/IXWebSocketCloseInfo.h
ixwebsocket/IXWebSocketErrorInfo.h
ixwebsocket/IXWebsocketExport.h
ixwebsocket/IXWebSocketHandshake.h
ixwebsocket/IXWebSocketHandshakeKeyGen.h
ixwebsocket/IXWebSocketHttpHeaders.h
@ -173,6 +174,10 @@ else()
${IXWEBSOCKET_SOURCES}
${IXWEBSOCKET_HEADERS}
)
if( MSVC )
target_compile_definitions(ixwebsocket PUBLIC IXWEBSOCKET_STATIC_DEFINE)
endif()
endif()
if (USE_TLS)
@ -286,6 +291,7 @@ if (IXWEBSOCKET_INSTALL)
install(TARGETS ixwebsocket
EXPORT ixwebsocket
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ixwebsocket/
)