From f7e1e0545fc3050a70eb33363afa2d88432fd006 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 19 May 2023 15:07:45 -0400 Subject: FindOpenSSL: Enable static library dependencies on more platforms Activate the logic from commit 8098bd5768 (FindOpenSSL: add pthread and dl dependencies to static lib on Linux, 2019-09-13, v3.16.0-rc1~72^2) on more UNIX platforms. Fixes: #24870 --- Modules/FindOpenSSL.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake index 45dc9ac..ff93a47 100644 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@ -113,7 +113,7 @@ The following variables may be set to control search behavior: macro(_OpenSSL_test_and_find_dependencies ssl_library crypto_library) unset(_OpenSSL_extra_static_deps) - if((CMAKE_SYSTEM_NAME STREQUAL "Linux") AND + if(UNIX AND (("${ssl_library}" MATCHES "\\${CMAKE_STATIC_LIBRARY_SUFFIX}$") OR ("${crypto_library}" MATCHES "\\${CMAKE_STATIC_LIBRARY_SUFFIX}$"))) set(_OpenSSL_has_dependencies TRUE) @@ -140,7 +140,7 @@ macro(_OpenSSL_test_and_find_dependencies ssl_library crypto_library) endif() endforeach() unset(_OPENSSL_DEP_LIB) - else() + elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") set(_OpenSSL_has_dependency_dl TRUE) endif() if(_OpenSSL_ldflags_other) @@ -152,7 +152,7 @@ macro(_OpenSSL_test_and_find_dependencies ssl_library crypto_library) endif() endforeach() unset(_OPENSSL_DEP_LDFLAG) - else() + elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") set(_OpenSSL_has_dependency_threads TRUE) find_package(Threads) endif() -- cgit v0.12