Skip to content

Commit

Permalink
Allow add extra libraries for OpenSSL
Browse files Browse the repository at this point in the history
Some platforms such as MSYS2 provide a broken libcrypto.pc, this is needed to fix statically link build.
  • Loading branch information
Andarwinux authored and blapie committed May 31, 2024
1 parent 6c6db81 commit 0e3cac2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ if (SLEEF_BUILD_STATIC_TEST_BINS)
set(CMAKE_EXE_LINKER_FLAGS "-static")
endif()

set(OPENSSL_EXTRA_LIBRARIES "" CACHE STRING "Extra libraries for openssl")
if (NOT CMAKE_CROSSCOMPILING AND NOT SLEEF_FORCE_FIND_PACKAGE_SSL)
find_package(OpenSSL)
if (OPENSSL_FOUND)
Expand All @@ -24,6 +25,7 @@ if (NOT CMAKE_CROSSCOMPILING AND NOT SLEEF_FORCE_FIND_PACKAGE_SSL)
SLEEF_OPENSSL_LIBRARIES "${OPENSSL_LIBRARIES}")
endif()
set(SLEEF_OPENSSL_VERSION ${OPENSSL_VERSION})
set(SLEEF_OPENSSL_LIBRARIES ${SLEEF_OPENSSL_LIBRARIES} ${OPENSSL_EXTRA_LIBRARIES})
set(SLEEF_OPENSSL_INCLUDE_DIR ${OPENSSL_INCLUDE_DIR})
endif()
else()
Expand All @@ -32,7 +34,7 @@ else()
find_library(LIBCRYPTO crypto)
if (LIBSSL AND LIBCRYPTO)
set(SLEEF_OPENSSL_FOUND TRUE)
set(SLEEF_OPENSSL_LIBRARIES ${LIBSSL} ${LIBCRYPTO})
set(SLEEF_OPENSSL_LIBRARIES ${LIBSSL} ${LIBCRYPTO} ${OPENSSL_EXTRA_LIBRARIES})
set(SLEEF_OPENSSL_VERSION ${LIBSSL})
endif()
endif()
Expand Down

0 comments on commit 0e3cac2

Please sign in to comment.