File tree Expand file tree Collapse file tree 3 files changed +58
-28
lines changed
Expand file tree Collapse file tree 3 files changed +58
-28
lines changed Original file line number Diff line number Diff line change 1- IF (COREFOUNDATION_INCLUDE_DIR AND COREFOUNDATION_DIRS)
1+ # Find CoreFoundation.framework
2+ # This will define :
3+ #
4+ # COREFOUNDATION_FOUND
5+ # COREFOUNDATION_LIBRARIES
6+ # COREFOUNDATION_LDFLAGS
7+ #
8+
9+ FIND_PATH (COREFOUNDATION_INCLUDE_DIR NAMES CoreFoundation.h)
10+ FIND_LIBRARY (COREFOUNDATION_LIBRARIES NAMES CoreFoundation)
11+ IF (COREFOUNDATION_INCLUDE_DIR AND COREFOUNDATION_LIBRARIES)
12+ IF (NOT CoreFoundation_FIND_QUIETLY)
13+ MESSAGE ("-- Found CoreFoundation ${COREFOUNDATION_LIBRARIES} " )
14+ ENDIF ()
215 SET (COREFOUNDATION_FOUND TRUE )
3- ELSE ()
4- FIND_PATH (COREFOUNDATION_INCLUDE_DIR NAMES CoreFoundation.h)
5- FIND_LIBRARY (COREFOUNDATION_DIRS NAMES CoreFoundation)
6- IF (COREFOUNDATION_INCLUDE_DIR AND COREFOUNDATION_DIRS)
7- SET (COREFOUNDATION_FOUND TRUE )
8- ENDIF ()
16+ SET (COREFOUNDATION_LDFLAGS "-framework CoreFoundation" )
917ENDIF ()
18+
19+ IF (CoreFoundation_FIND_REQUIRED AND NOT COREFOUNDATION_FOUND)
20+ MESSAGE (FATAL "-- CoreFoundation not found" )
21+ ENDIF ()
22+
23+ MARK_AS_ADVANCED (
24+ COREFOUNDATION_INCLUDE_DIR
25+ COREFOUNDATION_LIBRARIES
26+ )
Original file line number Diff line number Diff line change 1- IF (SECURITY_INCLUDE_DIR AND SECURITY_DIRS)
1+ # Find Security.framework
2+ # This will define :
3+ #
4+ # SECURITY_FOUND
5+ # SECURITY_LIBRARIES
6+ # SECURITY_LDFLAGS
7+ # SECURITY_HAS_SSLCREATECONTEXT
8+ #
9+
10+ FIND_PATH (SECURITY_INCLUDE_DIR NAMES Security/Security.h)
11+ FIND_LIBRARY (SECURITY_LIBRARIES NAMES Security)
12+ IF (SECURITY_INCLUDE_DIR AND SECURITY_LIBRARIES)
13+ IF (NOT Security_FIND_QUIETLY)
14+ MESSAGE ("-- Found Security ${SECURITY_LIBRARIES} " )
15+ ENDIF ()
216 SET (SECURITY_FOUND TRUE )
3- ELSE ()
4- FIND_PATH (SECURITY_INCLUDE_DIR NAMES Security/Security.h)
5- FIND_LIBRARY (SECURITY_DIRS NAMES Security)
6- IF (SECURITY_INCLUDE_DIR AND SECURITY_DIRS)
7- SET (SECURITY_FOUND TRUE )
8- ENDIF ()
17+ SET (SECURITY_LDFLAGS "-framework Security" )
18+ CHECK_LIBRARY_EXISTS("${SECURITY_LIBRARIES} " SSLCreateContext "Security/SecureTransport.h" SECURITY_HAS_SSLCREATECONTEXT)
919ENDIF ()
20+
21+ IF (Security_FIND_REQUIRED AND NOT SECURITY_FOUND)
22+ MESSAGE (FATAL "-- Security not found" )
23+ ENDIF ()
24+
25+ MARK_AS_ADVANCED (
26+ SECURITY_INCLUDE_DIR
27+ SECURITY_LIBRARIES
28+ )
Original file line number Diff line number Diff line change @@ -95,23 +95,17 @@ IF(THREADSAFE)
9595ENDIF ()
9696
9797IF (SECURITY_FOUND)
98- # OS X 10.7 and older do not have some functions we use, fall back to OpenSSL there
99- CHECK_LIBRARY_EXISTS("${SECURITY_DIRS} " SSLCreateContext "Security/SecureTransport.h" HAVE_NEWER_SECURITY)
100- IF (HAVE_NEWER_SECURITY)
101- MESSAGE ("-- Found Security ${SECURITY_DIRS} " )
102- LIST (APPEND LIBGIT2_PC_LIBS "-framework Security" )
103- LIST (APPEND LIBGIT2_LIBS ${SECURITY_DIRS} )
104- ELSE ()
105- MESSAGE ("-- Security framework is too old, falling back to OpenSSL" )
106- SET (SECURITY_FOUND "NO" )
107- SET (USE_OPENSSL "ON" )
108- ENDIF ()
98+ IF (SECURITY_HAS_SSLCREATECONTEXT)
99+ LIST (APPEND LIBGIT2_PC_LIBS ${SECURITY_LDFLAGS} )
100+ ELSE ()
101+ MESSAGE ("-- Security framework is too old, falling back to OpenSSL" )
102+ SET (USE_OPENSSL "ON" )
103+ ENDIF ()
109104ENDIF ()
110105
111106IF (COREFOUNDATION_FOUND)
112- MESSAGE ("-- Found CoreFoundation ${COREFOUNDATION_DIRS} " )
113- LIST (APPEND LIBGIT2_PC_LIBS "-framework CoreFoundation" )
114- LIST (APPEND LIBGIT2_LIBS ${COREFOUNDATION_DIRS} )
107+ LIST (APPEND LIBGIT2_LIBS ${COREFOUNDATION_LIBRARIES} )
108+ LIST (APPEND LIBGIT2_PC_LIBS ${COREFOUNDATION_LDFLAGS} )
115109ENDIF ()
116110
117111
You can’t perform that action at this time.
0 commit comments