Export symbols into .def files on MSVC (#339)

Fix #335
This commit is contained in:
CryptoManiac 2022-01-04 23:13:38 +03:00 committed by GitHub
parent 47d0b70ebf
commit f53b2f8878
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -148,10 +148,29 @@ if (USE_TLS)
endif()
endif()
add_library( ixwebsocket
${IXWEBSOCKET_SOURCES}
${IXWEBSOCKET_HEADERS}
)
if(BUILD_SHARED_LIBS)
# Building shared library
if(MSVC)
# Workaround for some projects
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()
add_library( ixwebsocket SHARED
${IXWEBSOCKET_SOURCES}
${IXWEBSOCKET_HEADERS}
)
# Set library version
set_target_properties(ixwebsocket PROPERTIES VERSION 11.3.2)
else()
# Static library
add_library( ixwebsocket
${IXWEBSOCKET_SOURCES}
${IXWEBSOCKET_HEADERS}
)
endif()
if (USE_TLS)
target_compile_definitions(ixwebsocket PUBLIC IXWEBSOCKET_USE_TLS)