Skip to content

Commit b7c247b

Browse files
committed
cmake: include SHA1 headers into our source files
When selecting the SHA1 backend, we only include the respective C implementation of the selected backend. But since commit bd48bf3 (hash: introduce source files to break include circles, 2019-06-14), we have introduced separate headers and compilation units for all hashes. So by not including the headers, we may not honor them to compute whether a file needs to be recompiled and they also will not be displayed in IDEs. Add the header files to fix this problem.
1 parent 368b979 commit b7c247b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

cmake/Modules/SelectHashes.cmake

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ IF(SHA1_BACKEND STREQUAL "CollisionDetection")
3030
ADD_DEFINITIONS(-DSHA1DC_NO_STANDARD_INCLUDES=1)
3131
ADD_DEFINITIONS(-DSHA1DC_CUSTOM_INCLUDE_SHA1_C=\"common.h\")
3232
ADD_DEFINITIONS(-DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C=\"common.h\")
33-
FILE(GLOB SRC_SHA1 hash/sha1/collisiondetect.c hash/sha1/sha1dc/*)
33+
FILE(GLOB SRC_SHA1 hash/sha1/collisiondetect.* hash/sha1/sha1dc/*)
3434
ELSEIF(SHA1_BACKEND STREQUAL "OpenSSL")
3535
# OPENSSL_FOUND should already be set, we're checking HTTPS_BACKEND
3636

@@ -40,13 +40,13 @@ ELSEIF(SHA1_BACKEND STREQUAL "OpenSSL")
4040
ELSE()
4141
LIST(APPEND LIBGIT2_PC_REQUIRES "openssl")
4242
ENDIF()
43-
FILE(GLOB SRC_SHA1 hash/sha1/openssl.c)
43+
FILE(GLOB SRC_SHA1 hash/sha1/openssl.*)
4444
ELSEIF(SHA1_BACKEND STREQUAL "CommonCrypto")
4545
SET(GIT_SHA1_COMMON_CRYPTO 1)
46-
FILE(GLOB SRC_SHA1 hash/sha1/common_crypto.c)
46+
FILE(GLOB SRC_SHA1 hash/sha1/common_crypto.*)
4747
ELSEIF(SHA1_BACKEND STREQUAL "mbedTLS")
4848
SET(GIT_SHA1_MBEDTLS 1)
49-
FILE(GLOB SRC_SHA1 hash/sha1/mbedtls.c)
49+
FILE(GLOB SRC_SHA1 hash/sha1/mbedtls.*)
5050
LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${MBEDTLS_INCLUDE_DIR})
5151
LIST(APPEND LIBGIT2_LIBS ${MBEDTLS_LIBRARIES})
5252
# mbedTLS has no pkgconfig file, hence we can't require it
@@ -55,9 +55,9 @@ ELSEIF(SHA1_BACKEND STREQUAL "mbedTLS")
5555
LIST(APPEND LIBGIT2_PC_LIBS ${MBEDTLS_LIBRARIES})
5656
ELSEIF(SHA1_BACKEND STREQUAL "Win32")
5757
SET(GIT_SHA1_WIN32 1)
58-
FILE(GLOB SRC_SHA1 hash/sha1/win32.c)
58+
FILE(GLOB SRC_SHA1 hash/sha1/win32.*)
5959
ELSEIF(SHA1_BACKEND STREQUAL "Generic")
60-
FILE(GLOB SRC_SHA1 hash/sha1/generic.c)
60+
FILE(GLOB SRC_SHA1 hash/sha1/generic.*)
6161
# ELSEIF(NOT USE_SHA1)
6262
ELSE()
6363
MESSAGE(FATAL_ERROR "Asked for unknown SHA1 backend: ${SHA1_BACKEND}")

0 commit comments

Comments
 (0)