Skip to content

Commit

Permalink
fix import/export macros, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
obiltschnig committed Aug 29, 2023
1 parent 7440719 commit 21a4612
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
15 changes: 8 additions & 7 deletions WebTunnel/WebTunnelClientLib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if(MSVC AND BUILD_SHARED_LIBS)
endif()

if(WEBTUNNELCLIENTLIB_MODULE)
set(WEBTUNNELCLIENTLIB_TYPE MODULE)
set(WEBTUNNELCLIENTLIB_TYPE MODULE)
set(CMAKE_DEBUG_POSTFIX "" CACHE STRING "Set Debug library postfix" FORCE)
set(CMAKE_RELEASE_POSTFIX "" CACHE STRING "Set Release library postfix" FORCE)
set(CMAKE_MINSIZEREL_POSTFIX "" CACHE STRING "Set MinSizeRel library postfix" FORCE)
Expand All @@ -31,25 +31,26 @@ else()
endif()

add_library(WebTunnelClientLib ${WEBTUNNELCLIENTLIB_TYPE} ${SRCS})

if(NOT ${WEBTUNNELCLIENTLIB_TYPE} STREQUAL "STATIC")
target_compile_definitions(WebTunnelClientLib PUBLIC WebTunnelClient_DLL)
endif()

set_target_properties(WebTunnelClientLib
PROPERTIES
OUTPUT_NAME WebTunnelClient
DEFINE_SYMBOL WebTunnelClient_EXPORTS
)

if (MSVC AND BUILD_SHARED_LIBS)
target_compile_definitions(WebTunnelClientLib PRIVATE WebTunnelClient_EXPORTS)
endif()

if(ENABLE_NETSSL_WIN)
target_compile_definitions(WebTunnelClientLib PUBLIC WEBTUNNEL_ENABLE_TLS=1)
target_compile_definitions(WebTunnelClientLib PRIVATE WEBTUNNEL_ENABLE_TLS=1)
target_link_libraries(WebTunnelClientLib Poco::NetSSLWin)
else()
find_package(OpenSSL)
if(OPENSSL_FOUND)
if(ENABLE_NETSSL)
target_include_directories(WebTunnelClientLib PUBLIC "${OPENSSL_INCLUDE_DIR}")
target_compile_definitions(WebTunnelClientLib PUBLIC WEBTUNNEL_ENABLE_TLS=1)
target_compile_definitions(WebTunnelClientLib PRIVATE WEBTUNNEL_ENABLE_TLS=1)
target_link_libraries(WebTunnelClientLib Poco::NetSSL Poco::Crypto ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})
endif()
endif()
Expand Down
4 changes: 2 additions & 2 deletions WebTunnel/WebTunnelClientLib/include/webtunnelclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
// WebTunnel_API functions as being imported from a DLL, wheras this DLL sees symbols
// defined with this macro as being exported.
*/
#if defined(_WIN32)
#if defined(_WIN32) && defined(WebTunnelClient_DLL)
#if defined(WebTunnelClient_EXPORTS)
#define WebTunnelClient_API __declspec(dllexport)
#else
Expand All @@ -39,7 +39,7 @@
/*
// Automatically link WebTunnelClientCAPI library.
*/
#if defined(_MSC_VER)
#if defined(_MSC_VER) && defined(WebTunnelClient_DLL)
#if !defined(WebTunnelClient_EXPORTS)
#if defined(_DEBUG)
#pragma comment(lib, "WebTunnelClientd.lib")
Expand Down

0 comments on commit 21a4612

Please sign in to comment.