summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2021-08-11 01:30:38 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2021-08-12 23:08:19 +0100
commite9c4caa8f4b5a004c56189a6f83395f809e8cbf8 (patch)
treeb2847f96fc1c72463741caa31a10a7b1f67433eb /cmake
parent806778dc482e40d26bc7a9d44ccd18b888f6ec33 (diff)
downloadlibgit2-ethomson/ssl_refactor.tar.gz
openssl: dynamically load libssl and symbols (optionally)ethomson/ssl_refactor
Provide an interface around OpenSSL to dynamically load the libraries and symbols, so that users can distribute a libgit2 library that is not linked directly against OpenSSL. This enables users to target multiple distributions with a single binary. This mechanism is optional and disabled by default. Configure cmake with -DUSE_HTTPS=OpenSSL-Dynamic to use it.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/SelectHTTPSBackend.cmake4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmake/SelectHTTPSBackend.cmake b/cmake/SelectHTTPSBackend.cmake
index afbeac424..4998f0f2a 100644
--- a/cmake/SelectHTTPSBackend.cmake
+++ b/cmake/SelectHTTPSBackend.cmake
@@ -108,6 +108,10 @@ IF(USE_HTTPS)
LIST(APPEND LIBGIT2_PC_LIBS ${MBEDTLS_LIBRARIES})
ELSEIF (USE_HTTPS STREQUAL "WinHTTP")
# WinHTTP setup was handled in the WinHTTP-specific block above
+ ELSEIF (USE_HTTPS STREQUAL "OpenSSL-Dynamic")
+ SET(GIT_OPENSSL 1)
+ SET(GIT_OPENSSL_DYNAMIC 1)
+ LIST(APPEND LIBGIT2_LIBS dl)
ELSE()
MESSAGE(FATAL_ERROR "Asked for backend ${USE_HTTPS} but it wasn't found")
ENDIF()