Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[build] fix when openssl is static build fail #3097

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ option(ENABLE_CODE_COVERAGE "Enable code coverage reporting" OFF)
option(ENABLE_MONOTONIC_CLOCK "Enforced clock_gettime with monotonic clock on GC CV" ${ENABLE_MONOTONIC_CLOCK_DEFAULT})
option(ENABLE_STDCXX_SYNC "Use C++11 chrono and threads for timing instead of pthreads" ${ENABLE_STDCXX_SYNC_DEFAULT})
option(USE_OPENSSL_PC "Use pkg-config to find OpenSSL libraries" ON)
option(OPENSSL_USE_STATIC_LIBS "Link OpenSSL libraries statically." OFF)
option(USE_OPENSSL_STATIC_LIBS "Link OpenSSL libraries statically." OFF)
option(USE_BUSY_WAITING "Enable more accurate sending times at a cost of potentially higher CPU load" OFF)
option(USE_GNUSTL "Get c++ library/headers from the gnustl.pc" OFF)
option(ENABLE_SOCK_CLOEXEC "Enable setting SOCK_CLOEXEC on a socket" ON)
Expand Down Expand Up @@ -389,7 +389,7 @@ if (ENABLE_ENCRYPTION)
# fall back to find_package method otherwise
if (USE_OPENSSL_PC)
pkg_check_modules(SSL ${SSL_REQUIRED_MODULES})
if (OPENSSL_USE_STATIC_LIBS)
if (USE_OPENSSL_STATIC_LIBS)
# use `pkg-config --static xxx` found libs
set(SSL_LIBRARIES ${SSL_STATIC_LIBRARIES})
endif()
Expand Down Expand Up @@ -1079,7 +1079,7 @@ if (srt_libspec_shared)
if (MICROSOFT)
target_link_libraries(${TARGET_srt}_shared PRIVATE ws2_32.lib)
if (NOT (ENABLE_ENCRYPTION AND "${USE_ENCLIB}" STREQUAL "botan"))
if (OPENSSL_USE_STATIC_LIBS)
if (USE_OPENSSL_STATIC_LIBS)
target_link_libraries(${TARGET_srt}_shared PRIVATE crypt32.lib)
else()
set_target_properties(${TARGET_srt}_shared PROPERTIES LINK_FLAGS "/DELAYLOAD:libeay32.dll")
Expand Down Expand Up @@ -1118,7 +1118,7 @@ if (srt_libspec_static)
endif()
if (MICROSOFT)
target_link_libraries(${TARGET_srt}_static PRIVATE ws2_32.lib)
if (OPENSSL_USE_STATIC_LIBS)
if (USE_OPENSSL_STATIC_LIBS)
target_link_libraries(${TARGET_srt}_static PRIVATE crypt32.lib)
endif()
elseif (MINGW)
Expand All @@ -1132,7 +1132,7 @@ endif()
target_include_directories(srt_virtual PRIVATE ${SSL_INCLUDE_DIRS})

if (MICROSOFT)
if (OPENSSL_USE_STATIC_LIBS)
if (USE_OPENSSL_STATIC_LIBS)
set (SRT_LIBS_PRIVATE ${SRT_LIBS_PRIVATE} ws2_32.lib crypt32.lib)
else()
set (SRT_LIBS_PRIVATE ${SRT_LIBS_PRIVATE} ws2_32.lib)
Expand Down Expand Up @@ -1174,7 +1174,7 @@ endif()
if (srt_libspec_shared)
if (MICROSOFT)
target_link_libraries(${TARGET_srt}_shared PUBLIC Ws2_32.lib)
if (OPENSSL_USE_STATIC_LIBS)
if (USE_OPENSSL_STATIC_LIBS)
target_link_libraries(${TARGET_srt}_shared PUBLIC crypt32.lib)
endif()
endif()
Expand Down