Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-08-20 15:53:51 +0300
committerCarlos Martín Nieto <cmn@dwim.me>2015-08-20 15:53:51 +0300
commit8820160818c8a15e345c0da13560bef9771e12c5 (patch)
treeab790cc920c924c53ed63ceae5639015494826db
parenta38afb9547534af3b0a3d09fc24057b68cc8cf6b (diff)
parentb445940e2d891a72a7d623bc7efa7649e19863e6 (diff)
Merge pull request #3389 from libgit2/cmn/old-security
CMake: fall back to OpenSSL on older OS X
-rw-r--r--CMakeLists.txt14
1 files changed, 12 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b6a8b6d4e..6c03c718c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -152,8 +152,18 @@ STRING(REGEX REPLACE "^.*LIBGIT2_SOVERSION ([0-9]+)$" "\\1" LIBGIT2_SOVERSION "$
INCLUDE_DIRECTORIES(src include)
IF (SECURITY_FOUND)
- MESSAGE("-- Found Security ${SECURITY_DIRS}")
- LIST(APPEND LIBGIT2_PC_LIBS "-framework Security")
+ # OS X 10.7 and older do not have some functions we use, fall back to OpenSSL there
+ CHECK_LIBRARY_EXISTS("${SECURITY_DIRS}" SSLCreateContext "Security/SecureTransport.h" HAVE_NEWER_SECURITY)
+ IF (HAVE_NEWER_SECURITY)
+ MESSAGE("-- Found Security ${SECURITY_DIRS}")
+ LIST(APPEND LIBGIT2_PC_LIBS "-framework Security")
+ ELSE()
+ MESSAGE("-- Security framework is too old, falling back to OpenSSL")
+ SET(SECURITY_FOUND "NO")
+ SET(SECURITY_DIRS "")
+ SET(SECURITY_DIR "")
+ SET(USE_OPENSSL "ON")
+ ENDIF()
ENDIF()
IF (COREFOUNDATION_FOUND)