summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2012-06-08 19:37:24 +0100
committerChris Young <chris@unsatisfactorysoftware.co.uk>2012-06-08 19:37:24 +0100
commitc3f7a9386d1f244a5442a1be484e1093b1698a02 (patch)
tree4e9b730d9606cd2a681175930ed95ab5a92bfa5e /CMakeLists.txt
parentfa56478fb8d5e19d64bf43b51372ab3315cb1884 (diff)
downloadlibgit2-c3f7a9386d1f244a5442a1be484e1093b1698a02.tar.gz
Re-add the ability to select the PowerPC SHA1 function
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt13
1 files changed, 12 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7d3df285e..c6254efda 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,11 +23,22 @@ STRING(REGEX REPLACE "^.*LIBGIT2_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" LIBGIT2_V
STRING(REGEX REPLACE "^.*LIBGIT2_VERSION \"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" LIBGIT2_VERSION_REV "${GIT2_HEADER}")
SET(LIBGIT2_VERSION_STRING "${LIBGIT2_VERSION_MAJOR}.${LIBGIT2_VERSION_MINOR}.${LIBGIT2_VERSION_REV}")
+# Comment out the line below to use OpenSSL SHA1
+SET(SHA1_TYPE "ppc")
+
# Find required dependencies
INCLUDE_DIRECTORIES(src include deps/http-parser)
FILE(GLOB SRC_HTTP deps/http-parser/*.c)
+# Specify sha1 implementation
+IF (SHA1_TYPE STREQUAL "ppc")
+ ADD_DEFINITIONS(-DPPC_SHA1)
+ FILE(GLOB SRC_SHA1 src/ppc/*.c)
+ELSE ()
+ SET (SRC_SHA1)
+ENDIF()
+
IF (NOT WIN32)
FIND_PACKAGE(ZLIB)
ELSE()
@@ -122,7 +133,7 @@ ELSE()
ENDIF ()
# Compile and link libgit2
-ADD_LIBRARY(git2 ${SRC} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX} ${WIN_RC})
+ADD_LIBRARY(git2 ${SRC} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX} ${SRC_SHA1} ${WIN_RC})
IF (WIN32)
TARGET_LINK_LIBRARIES(git2 ws2_32)