diff options
author | Patrick Steinhardt <ps@pks.im> | 2019-06-14 14:22:19 +0200 |
---|---|---|
committer | Patrick Steinhardt <ps@pks.im> | 2019-06-24 18:33:22 +0200 |
commit | fda206228f5df603a6fc3a81092e36850d4879b2 (patch) | |
tree | ed7e46b134d5611d3441cd92acbc775908b4de4e /cmake | |
parent | bd48bf3fb9368541bafda7877cf159f94884c187 (diff) | |
download | libgit2-fda206228f5df603a6fc3a81092e36850d4879b2.tar.gz |
hash: move SHA1 implementations into 'sha1/' folder
As we will include additional hash algorithms in the future due
to upstream git discussing a move away from SHA1, we should
accomodate for that and prepare for the move. As a first step,
move all SHA1 implementations into a common subdirectory.
Also, create a SHA1-specific header file that lives inside the
hash folder. This header will contain the SHA1-specific header
includes, function declarations and the SHA1 context structure.
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Modules/SelectHashes.cmake | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cmake/Modules/SelectHashes.cmake b/cmake/Modules/SelectHashes.cmake index 78ff41f57..e6751adbd 100644 --- a/cmake/Modules/SelectHashes.cmake +++ b/cmake/Modules/SelectHashes.cmake @@ -30,7 +30,7 @@ IF(SHA1_BACKEND STREQUAL "CollisionDetection") ADD_DEFINITIONS(-DSHA1DC_NO_STANDARD_INCLUDES=1) ADD_DEFINITIONS(-DSHA1DC_CUSTOM_INCLUDE_SHA1_C=\"common.h\") ADD_DEFINITIONS(-DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C=\"common.h\") - FILE(GLOB SRC_SHA1 hash/hash_collisiondetect.c hash/sha1dc/*) + FILE(GLOB SRC_SHA1 hash/sha1/collisiondetect.c hash/sha1/sha1dc/*) ELSEIF(SHA1_BACKEND STREQUAL "OpenSSL") # OPENSSL_FOUND should already be set, we're checking HTTPS_BACKEND @@ -40,13 +40,13 @@ ELSEIF(SHA1_BACKEND STREQUAL "OpenSSL") ELSE() LIST(APPEND LIBGIT2_PC_REQUIRES "openssl") ENDIF() - FILE(GLOB SRC_SHA1 hash/hash_openssl.c) + FILE(GLOB SRC_SHA1 hash/sha1/openssl.c) ELSEIF(SHA1_BACKEND STREQUAL "CommonCrypto") SET(GIT_SHA1_COMMON_CRYPTO 1) - FILE(GLOB SRC_SHA1 hash/hash_common_crypto.c) + FILE(GLOB SRC_SHA1 hash/sha1/common_crypto.c) ELSEIF(SHA1_BACKEND STREQUAL "mbedTLS") SET(GIT_SHA1_MBEDTLS 1) - FILE(GLOB SRC_SHA1 hash/hash_mbedtls.c) + FILE(GLOB SRC_SHA1 hash/sha1/mbedtls.c) LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${MBEDTLS_INCLUDE_DIR}) LIST(APPEND LIBGIT2_LIBS ${MBEDTLS_LIBRARIES}) # mbedTLS has no pkgconfig file, hence we can't require it @@ -55,9 +55,9 @@ ELSEIF(SHA1_BACKEND STREQUAL "mbedTLS") LIST(APPEND LIBGIT2_PC_LIBS ${MBEDTLS_LIBRARIES}) ELSEIF(SHA1_BACKEND STREQUAL "Win32") SET(GIT_SHA1_WIN32 1) - FILE(GLOB SRC_SHA1 hash/hash_win32.c) + FILE(GLOB SRC_SHA1 hash/sha1/win32.c) ELSEIF(SHA1_BACKEND STREQUAL "Generic") - FILE(GLOB SRC_SHA1 hash/hash_generic.c) + FILE(GLOB SRC_SHA1 hash/sha1/generic.c) # ELSEIF(NOT USE_SHA1) ELSE() MESSAGE(FATAL_ERROR "Asked for unknown SHA1 backend: ${SHA1_BACKEND}") |