summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2021-12-12 15:14:21 -0500
committerEdward Thomson <ethomson@edwardthomson.com>2022-03-23 08:39:19 -0400
commit83c2778611a4f71b7bd841f643ac457af3f23248 (patch)
tree4255edc100c212826aaff9ea1f3bf83d84f9e4e0 /cmake
parentb900981cf7f6499b99cf83f77f73cf5fc436653b (diff)
downloadlibgit2-83c2778611a4f71b7bd841f643ac457af3f23248.tar.gz
sha: support CommonCrypto for SHA256
Diffstat (limited to 'cmake')
-rw-r--r--cmake/SelectHashes.cmake16
1 files changed, 15 insertions, 1 deletions
diff --git a/cmake/SelectHashes.cmake b/cmake/SelectHashes.cmake
index a34651a90..acd470654 100644
--- a/cmake/SelectHashes.cmake
+++ b/cmake/SelectHashes.cmake
@@ -47,12 +47,26 @@ else()
message(FATAL_ERROR "Asked for unknown SHA1 backend: ${USE_SHA1}")
endif()
-if(USE_SHA256 STREQUAL ON)
+if(USE_SHA256 STREQUAL ON AND USE_HTTPS)
+ SET(USE_SHA256 "HTTPS")
+elseif(USE_SHA256 STREQUAL ON)
SET(USE_SHA256 "Builtin")
endif()
+if(USE_SHA256 STREQUAL "HTTPS")
+ if(USE_HTTPS STREQUAL "SecureTransport")
+ set(USE_SHA256 "CommonCrypto")
+ elseif(USE_HTTPS STREQUAL "WinHTTP")
+ set(USE_SHA256 "Win32")
+ elseif(USE_HTTPS)
+ set(USE_SHA256 ${USE_HTTPS})
+ endif()
+endif()
+
if(USE_SHA256 STREQUAL "Builtin")
set(GIT_SHA256_BUILTIN 1)
+elseif(USE_SHA256 STREQUAL "CommonCrypto")
+ set(GIT_SHA256_COMMON_CRYPTO 1)
else()
message(FATAL_ERROR "Asked for unknown SHA256 backend: ${USE_SHA256}")
endif()