Commit 54554757 by Etienne Samson

cmake: make our preferred backend ordering consistent

parent e3d764a4
...@@ -133,6 +133,8 @@ ELSE () ...@@ -133,6 +133,8 @@ ELSE ()
ENDIF() ENDIF()
IF (USE_HTTPS) IF (USE_HTTPS)
# We try to find any packages our backends might use
FIND_PACKAGE(OpenSSL)
FIND_PACKAGE(mbedTLS) FIND_PACKAGE(mbedTLS)
IF (CMAKE_SYSTEM_NAME MATCHES "Darwin") IF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
FIND_PACKAGE(Security) FIND_PACKAGE(Security)
...@@ -150,10 +152,13 @@ IF (USE_HTTPS) ...@@ -150,10 +152,13 @@ IF (USE_HTTPS)
ENDIF() ENDIF()
ELSEIF (WINHTTP) ELSEIF (WINHTTP)
SET(HTTPS_BACKEND "WinHTTP") SET(HTTPS_BACKEND "WinHTTP")
ELSEIF(OPENSSL_FOUND)
SET(HTTPS_BACKEND "OpenSSL")
ELSEIF(MBEDTLS_FOUND) ELSEIF(MBEDTLS_FOUND)
SET(HTTPS_BACKEND "mbedTLS") SET(HTTPS_BACKEND "mbedTLS")
ELSE() ELSE()
SET(HTTPS_BACKEND "OpenSSL") MESSAGE(FATAL_ERROR "Unable to autodetect a usable HTTPS backend."
"Please pass the backend name explicitly (-DUSE_HTTPS=backend)")
ENDIF() ENDIF()
ELSE() ELSE()
# Backend was explicitly set # Backend was explicitly set
...@@ -177,8 +182,6 @@ IF (USE_HTTPS) ...@@ -177,8 +182,6 @@ IF (USE_HTTPS)
LIST(APPEND LIBGIT2_LIBS ${COREFOUNDATION_LIBRARIES} ${SECURITY_LIBRARIES}) LIST(APPEND LIBGIT2_LIBS ${COREFOUNDATION_LIBRARIES} ${SECURITY_LIBRARIES})
LIST(APPEND LIBGIT2_PC_LIBS ${COREFOUNDATION_LDFLAGS} ${SECURITY_LDFLAGS}) LIST(APPEND LIBGIT2_PC_LIBS ${COREFOUNDATION_LDFLAGS} ${SECURITY_LDFLAGS})
ELSEIF (HTTPS_BACKEND STREQUAL "OpenSSL") ELSEIF (HTTPS_BACKEND STREQUAL "OpenSSL")
FIND_PACKAGE(OpenSSL)
IF (NOT OPENSSL_FOUND) IF (NOT OPENSSL_FOUND)
MESSAGE(FATAL_ERROR "Asked for OpenSSL TLS backend, but it wasn't found") MESSAGE(FATAL_ERROR "Asked for OpenSSL TLS backend, but it wasn't found")
ENDIF() ENDIF()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment