diff options
author | Brad King <brad.king@kitware.com> | 2023-02-24 13:29:31 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-02-24 13:29:52 (GMT) |
commit | 030c70f92a13eb1420013d03e6fe1a82313f26d0 (patch) | |
tree | 26544354c0a447c4c95dbebfa5ae0718b3e317dd | |
parent | b8ee18759ba6bcad6820df060ba5c0b8df36b740 (diff) | |
parent | 24c7279a6f2c895c6c24cbc3f2b22e00baa42173 (diff) | |
download | CMake-030c70f92a13eb1420013d03e6fe1a82313f26d0.zip CMake-030c70f92a13eb1420013d03e6fe1a82313f26d0.tar.gz CMake-030c70f92a13eb1420013d03e6fe1a82313f26d0.tar.bz2 |
Merge topic 'find-openssl-find-pthread' into release-3.26
24c7279a6f FindOpenSSL: Search for -pthread flag
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8246
-rw-r--r-- | Modules/FindOpenSSL.cmake | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake index ae1148d..4e8374c 100644 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@ -120,12 +120,13 @@ macro(_OpenSSL_test_and_find_dependencies ssl_library crypto_library) unset(_OpenSSL_has_dependency_zlib) if(OPENSSL_USE_STATIC_LIBS) set(_OpenSSL_libs "${_OPENSSL_STATIC_LIBRARIES}") + set(_OpenSSL_ldflags_other "${_OPENSSL_STATIC_LDFLAGS_OTHER}") else() set(_OpenSSL_libs "${_OPENSSL_LIBRARIES}") + set(_OpenSSL_ldflags_other "${_OPENSSL_LDFLAGS_OTHER}") endif() if(_OpenSSL_libs) unset(_OpenSSL_has_dependency_dl) - unset(_OpenSSL_has_dependency_threads) foreach(_OPENSSL_DEP_LIB IN LISTS _OpenSSL_libs) if (_OPENSSL_DEP_LIB STREQUAL "ssl" OR _OPENSSL_DEP_LIB STREQUAL "crypto") # ignoring: these are the targets @@ -141,10 +142,22 @@ macro(_OpenSSL_test_and_find_dependencies ssl_library crypto_library) unset(_OPENSSL_DEP_LIB) else() set(_OpenSSL_has_dependency_dl TRUE) + endif() + if(_OpenSSL_ldflags_other) + unset(_OpenSSL_has_dependency_threads) + foreach(_OPENSSL_DEP_LDFLAG IN LISTS _OpenSSL_ldflags_other) + if (_OPENSSL_DEP_LDFLAG STREQUAL "-pthread") + set(_OpenSSL_has_dependency_threads TRUE) + find_package(Threads) + endif() + endforeach() + unset(_OPENSSL_DEP_LDFLAG) + else() set(_OpenSSL_has_dependency_threads TRUE) find_package(Threads) endif() unset(_OpenSSL_libs) + unset(_OpenSSL_ldflags_other) else() set(_OpenSSL_has_dependencies FALSE) endif() |