Skip to content

Commit

Permalink
Fix static link with openssl
Browse files Browse the repository at this point in the history
Recent versions of cmake stopped linking with -ldl implicitely,
which may be required when linking statically with openssl.
However this can still be done using find_package(OpenSSL) by
setting OPENSSL_USE_STATIC_LIBS to TRUE.
  • Loading branch information
blapie committed Jun 3, 2024
1 parent 23c1ad7 commit c23da1d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ endif()

set(OPENSSL_EXTRA_LIBRARIES "" CACHE STRING "Extra libraries for openssl")
if (NOT CMAKE_CROSSCOMPILING AND NOT SLEEF_FORCE_FIND_PACKAGE_SSL)
if (SLEEF_BUILD_STATIC_TEST_BINS)
set(OPENSSL_USE_STATIC_LIBS TRUE)
endif()
find_package(OpenSSL)
if (OPENSSL_FOUND)
set(SLEEF_OPENSSL_FOUND TRUE)
Expand Down

0 comments on commit c23da1d

Please sign in to comment.