summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2017-06-07 14:59:38 +0200
committerPatrick Steinhardt <ps@pks.im>2017-06-07 15:03:46 +0200
commitdb1abffa50929b6a6298ab53143f90cc3003fe1a (patch)
tree0dc34ef215a3cb34f323a4e8c116f17d0f8598f7
parent63d86c270334d7967b7cc2df762de3ea32e9d439 (diff)
downloadlibgit2-db1abffa50929b6a6298ab53143f90cc3003fe1a.tar.gz
sha1dc: do not use standard includes
The updated SHA1DC library allows us to use custom includes instead of using standard includes. Due to requirements with cross-platform, we provide some custom system includes files like for example the "stdint.h" file on Win32. Because of this, we want to make sure to avoid breaking cross-platform compatibility when SHA1DC is enabled. To use the new mechanism, we can simply define `SHA1DC_NO_STANDARD_INCLUDES`. Furthermore, we can specify custom include files via two defines, which we now use to include our "common.h" header.
-rw-r--r--CMakeLists.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3fb8ae2ab..354ae3e45 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -296,6 +296,9 @@ ENDIF()
# Specify sha1 implementation
IF (USE_SHA1DC)
ADD_DEFINITIONS(-DGIT_SHA1_COLLISIONDETECT)
+ 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 src/hash/hash_collisiondetect.c src/hash/sha1dc/*)
ELSEIF (WIN32 AND NOT MINGW)
ADD_DEFINITIONS(-DGIT_SHA1_WIN32)