File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,8 @@ ELSE ()
133133ENDIF ()
134134
135135IF (USE_HTTPS)
136+ # We try to find any packages our backends might use
137+ FIND_PACKAGE (OpenSSL)
136138 FIND_PACKAGE (mbedTLS)
137139 IF (CMAKE_SYSTEM_NAME MATCHES "Darwin" )
138140 FIND_PACKAGE (Security)
@@ -150,10 +152,13 @@ IF (USE_HTTPS)
150152 ENDIF ()
151153 ELSEIF (WINHTTP)
152154 SET (HTTPS_BACKEND "WinHTTP" )
155+ ELSEIF (OPENSSL_FOUND)
156+ SET (HTTPS_BACKEND "OpenSSL" )
153157 ELSEIF (MBEDTLS_FOUND)
154158 SET (HTTPS_BACKEND "mbedTLS" )
155159 ELSE ()
156- SET (HTTPS_BACKEND "OpenSSL" )
160+ MESSAGE (FATAL_ERROR "Unable to autodetect a usable HTTPS backend."
161+ "Please pass the backend name explicitly (-DUSE_HTTPS=backend)" )
157162 ENDIF ()
158163 ELSE ()
159164 # Backend was explicitly set
@@ -177,8 +182,6 @@ IF (USE_HTTPS)
177182 LIST (APPEND LIBGIT2_LIBS ${COREFOUNDATION_LIBRARIES} ${SECURITY_LIBRARIES} )
178183 LIST (APPEND LIBGIT2_PC_LIBS ${COREFOUNDATION_LDFLAGS} ${SECURITY_LDFLAGS} )
179184 ELSEIF (HTTPS_BACKEND STREQUAL "OpenSSL" )
180- FIND_PACKAGE (OpenSSL)
181-
182185 IF (NOT OPENSSL_FOUND)
183186 MESSAGE (FATAL_ERROR "Asked for OpenSSL TLS backend, but it wasn't found" )
184187 ENDIF ()
You can’t perform that action at this time.
0 commit comments