mirror of
https://github.com/libgit2/libgit2.git
synced 2026-01-25 02:56:17 +00:00
cmake: enforce USE_HTTPS validity
This commit is contained in:
@@ -31,7 +31,7 @@ option(USE_NSEC "Support nanosecond precision file mtimes and cti
|
||||
|
||||
# Backend selection
|
||||
set(USE_SSH "" CACHE STRING "Enables SSH support. One of libssh2, exec, or OFF. (Defaults to OFF.)")
|
||||
option(USE_HTTPS "Enable HTTPS support. Can be set to a specific backend" ON)
|
||||
set(USE_HTTPS "" CACHE STRING "Enable HTTPS support. One of ON (to autodetect), OFF, or a specific backend: OpenSSL, OpenSSL-FIPS, OpenSSL-Dynamic, mbedTLS, SecureTransport, Schannel, or WinHTTP. (Defaults to ON.)")
|
||||
option(USE_SHA1 "Enable SHA1. Can be set to CollisionDetection(ON)/HTTPS" ON)
|
||||
option(USE_SHA256 "Enable SHA256. Can be set to HTTPS/Builtin" ON)
|
||||
option(USE_GSSAPI "Link with libgssapi for SPNEGO auth" OFF)
|
||||
@@ -64,7 +64,7 @@ option(ENABLE_WERROR "Enable compilation with -Werror"
|
||||
|
||||
if(UNIX)
|
||||
# NTLM client requires crypto libraries from the system HTTPS stack
|
||||
if(NOT USE_HTTPS)
|
||||
if(USE_HTTPS STREQUAL "OFF")
|
||||
option(USE_NTLMCLIENT "Enable NTLM support on Unix." OFF)
|
||||
else()
|
||||
option(USE_NTLMCLIENT "Enable NTLM support on Unix." ON)
|
||||
|
||||
@@ -8,9 +8,14 @@ if(CMAKE_SYSTEM_NAME MATCHES "Darwin" OR CMAKE_SYSTEM_NAME MATCHES "iOS")
|
||||
find_package(CoreFoundation)
|
||||
endif()
|
||||
|
||||
if(USE_HTTPS STREQUAL "")
|
||||
set(USE_HTTPS ON)
|
||||
endif()
|
||||
|
||||
sanitizebool(USE_HTTPS)
|
||||
|
||||
if(USE_HTTPS)
|
||||
# Auto-select TLS backend
|
||||
sanitizebool(USE_HTTPS)
|
||||
if(USE_HTTPS STREQUAL ON)
|
||||
if(SECURITY_FOUND)
|
||||
if(SECURITY_HAS_SSLCREATECONTEXT)
|
||||
@@ -136,12 +141,12 @@ if(USE_HTTPS)
|
||||
set(GIT_OPENSSL_DYNAMIC 1)
|
||||
list(APPEND LIBGIT2_SYSTEM_LIBS dl)
|
||||
else()
|
||||
message(FATAL_ERROR "Asked for backend ${USE_HTTPS} but it wasn't found")
|
||||
message(FATAL_ERROR "unknown HTTPS backend: ${USE_HTTPS}")
|
||||
endif()
|
||||
|
||||
set(GIT_HTTPS 1)
|
||||
add_feature_info(HTTPS GIT_HTTPS "using ${USE_HTTPS}")
|
||||
else()
|
||||
set(GIT_HTTPS 0)
|
||||
add_feature_info(HTTPS NO "")
|
||||
add_feature_info(HTTPS NO "HTTPS support is disabled")
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user