summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2019-06-14 14:21:32 +0200
committerPatrick Steinhardt <ps@pks.im>2019-06-24 18:26:32 +0200
commitbd48bf3fb9368541bafda7877cf159f94884c187 (patch)
tree4d3a0c761cc6810791f9f9ec2858e41318be999c /cmake
parentbbf034ab931cd6346420066cbb00cf16ae893510 (diff)
downloadlibgit2-bd48bf3fb9368541bafda7877cf159f94884c187.tar.gz
hash: introduce source files to break include circles
The hash source files have circular include dependencies right now, which shows by our broken generic hash implementation. The "hash.h" header declares two functions and the `git_hash_ctx` typedef before actually including the hash backend header and can only declare the remaining hash functions after the include due to possibly static function declarations inside of the implementation includes. Let's break this cycle and help maintainability by creating a real implementation file for each of the hash implementations. Instead of relying on the exact include order, we now especially avoid the use of `GIT_INLINE` for function declarations.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/SelectHashes.cmake2
1 files changed, 2 insertions, 0 deletions
diff --git a/cmake/Modules/SelectHashes.cmake b/cmake/Modules/SelectHashes.cmake
index 450e2bddb..78ff41f57 100644
--- a/cmake/Modules/SelectHashes.cmake
+++ b/cmake/Modules/SelectHashes.cmake
@@ -40,8 +40,10 @@ ELSEIF(SHA1_BACKEND STREQUAL "OpenSSL")
ELSE()
LIST(APPEND LIBGIT2_PC_REQUIRES "openssl")
ENDIF()
+ FILE(GLOB SRC_SHA1 hash/hash_openssl.c)
ELSEIF(SHA1_BACKEND STREQUAL "CommonCrypto")
SET(GIT_SHA1_COMMON_CRYPTO 1)
+ FILE(GLOB SRC_SHA1 hash/hash_common_crypto.c)
ELSEIF(SHA1_BACKEND STREQUAL "mbedTLS")
SET(GIT_SHA1_MBEDTLS 1)
FILE(GLOB SRC_SHA1 hash/hash_mbedtls.c)