Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
fb84cde8
Commit
fb84cde8
authored
Jun 28, 2015
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3267 from libgit2/cmn/libs-list
CMake: treat the ld flags as a list
parents
fa399750
fd2d11a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
CMakeLists.txt
+14
-10
No files found.
CMakeLists.txt
View file @
fb84cde8
...
...
@@ -100,12 +100,14 @@ FUNCTION(TARGET_OS_LIBRARIES target)
TARGET_LINK_LIBRARIES
(
${
target
}
ws2_32
)
ELSEIF
(
CMAKE_SYSTEM_NAME MATCHES
"(Solaris|SunOS)"
)
TARGET_LINK_LIBRARIES
(
${
target
}
socket nsl
)
SET
(
LIBGIT2_PC_LIBS
"
${
LIBGIT2_PC_LIBS
}
-lsocket -lnsl"
PARENT_SCOPE
)
LIST
(
APPEND LIBGIT2_PC_LIBS
"-lsocket"
"-lnsl"
)
SET
(
LIBGIT2_PC_LIBS
${
LIBGIT2_PC_LIBS
}
PARENT_SCOPE
)
ENDIF
()
CHECK_LIBRARY_EXISTS
(
rt clock_gettime
"time.h"
NEED_LIBRT
)
IF
(
NEED_LIBRT
)
TARGET_LINK_LIBRARIES
(
${
target
}
rt
)
SET
(
LIBGIT2_PC_LIBS
"
${
LIBGIT2_PC_LIBS
}
-lrt"
PARENT_SCOPE
)
LIST
(
APPEND LIBGIT2_PC_LIBS
"-lrt"
)
SET
(
LIBGIT2_PC_LIBS
${
LIBGIT2_PC_LIBS
}
PARENT_SCOPE
)
ENDIF
()
IF
(
THREADSAFE
)
...
...
@@ -151,12 +153,12 @@ INCLUDE_DIRECTORIES(src include)
IF
(
SECURITY_FOUND
)
MESSAGE
(
"-- Found Security
${
SECURITY_DIRS
}
"
)
SET
(
LIBGIT2_PC_LIBS
"
${
LIBGIT2_PC_LIBS
}
-framework Security"
)
LIST
(
APPEND LIBGIT2_PC_LIBS
"
-framework Security"
)
ENDIF
()
IF
(
COREFOUNDATION_FOUND
)
MESSAGE
(
"-- Found CoreFoundation
${
COREFOUNDATION_DIRS
}
"
)
SET
(
LIBGIT2_PC_LIBS
"
${
LIBGIT2_PC_LIBS
}
-framework CoreFoundation"
)
LIST
(
APPEND LIBGIT2_PC_LIBS
"
-framework CoreFoundation"
)
ENDIF
()
...
...
@@ -212,14 +214,14 @@ ELSE ()
ADD_DEFINITIONS
(
-DGIT_CURL
)
INCLUDE_DIRECTORIES
(
${
CURL_INCLUDE_DIRS
}
)
LINK_LIBRARIES
(
${
CURL_LIBRARIES
}
)
SET
(
LIBGIT2_PC_LIBS
"
${
LIBGIT2_PC_LIBS
}
${
CURL_LDFLAGS
}
"
)
LIST
(
APPEND LIBGIT2_PC_LIBS
${
CURL_LDFLAGS
}
)
ENDIF
()
FIND_PACKAGE
(
HTTP_Parser
)
IF
(
HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUAL 2
)
INCLUDE_DIRECTORIES
(
${
HTTP_PARSER_INCLUDE_DIRS
}
)
LINK_LIBRARIES
(
${
HTTP_PARSER_LIBRARIES
}
)
SET
(
LIBGIT2_PC_LIBS
"
${
LIBGIT2_PC_LIBS
}
-lhttp_parser"
)
LIST
(
APPEND LIBGIT2_PC_LIBS
"
-lhttp_parser"
)
ELSE
()
MESSAGE
(
STATUS
"http-parser was not found or is too old; using bundled 3rd-party sources."
)
INCLUDE_DIRECTORIES
(
deps/http-parser
)
...
...
@@ -236,7 +238,7 @@ ELSEIF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
ELSEIF
(
OPENSSL_FOUND AND NOT SHA1_TYPE STREQUAL
"builtin"
)
ADD_DEFINITIONS
(
-DOPENSSL_SHA1
)
IF
(
CMAKE_SYSTEM_NAME MATCHES
"FreeBSD"
)
SET
(
LIBGIT2_PC_LIBS
"
${
LIBGIT2_PC_LIBS
}
-lssl"
)
LIST
(
APPEND LIBGIT2_PC_LIBS
"
-lssl"
)
ELSE
()
SET
(
LIBGIT2_PC_REQUIRES
"
${
LIBGIT2_PC_REQUIRES
}
openssl"
)
ENDIF
()
...
...
@@ -261,7 +263,7 @@ IF (ZLIB_FOUND)
INCLUDE_DIRECTORIES
(
${
ZLIB_INCLUDE_DIRS
}
)
LINK_LIBRARIES
(
${
ZLIB_LIBRARIES
}
)
IF
(
APPLE OR CMAKE_SYSTEM_NAME MATCHES
"FreeBSD"
)
SET
(
LIBGIT2_PC_LIBS
"
${
LIBGIT2_PC_LIBS
}
-lz"
)
LIST
(
APPEND LIBGIT2_PC_LIBS
"
-lz"
)
ELSE
()
SET
(
LIBGIT2_PC_REQUIRES
"
${
LIBGIT2_PC_REQUIRES
}
zlib"
)
ENDIF
()
...
...
@@ -280,7 +282,8 @@ IF (LIBSSH2_FOUND)
ADD_DEFINITIONS
(
-DGIT_SSH
)
INCLUDE_DIRECTORIES
(
${
LIBSSH2_INCLUDE_DIRS
}
)
LINK_DIRECTORIES
(
${
LIBSSH2_LIBRARY_DIRS
}
)
SET
(
LIBGIT2_PC_LIBS
"
${
LIBGIT2_PC_LIBS
}
${
LIBSSH2_LDFLAGS
}
"
)
LIST
(
APPEND LIBGIT2_PC_LIBS
${
LIBSSH2_LDFLAGS
}
)
#SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} ${LIBSSH2_LDFLAGS}")
SET
(
SSH_LIBRARIES
${
LIBSSH2_LIBRARIES
}
)
CHECK_LIBRARY_EXISTS
(
"
${
LIBSSH2_LIBRARIES
}
"
libssh2_userauth_publickey_frommemory
""
HAVE_LIBSSH2_MEMORY_CREDENTIALS
)
...
...
@@ -306,7 +309,7 @@ ENDIF()
IF
(
ICONV_FOUND
)
ADD_DEFINITIONS
(
-DGIT_USE_ICONV
)
INCLUDE_DIRECTORIES
(
${
ICONV_INCLUDE_DIR
}
)
SET
(
LIBGIT2_PC_LIBS
"
${
LIBGIT2_PC_LIBS
}
${
ICONV_LIBRARIES
}
"
)
LIST
(
APPEND LIBGIT2_PC_LIBS
${
ICONV_LIBRARIES
}
)
ENDIF
()
# Platform specific compilation flags
...
...
@@ -511,6 +514,7 @@ IF (SONAME)
SET_TARGET_PROPERTIES(git2 PROPERTIES OUTPUT_NAME
${
LIBGIT2_FILENAME
}
)
ENDIF()
ENDIF()
STRING(REPLACE "
;
" "
" LIBGIT2_PC_LIBS "
${
LIBGIT2_PC_LIBS
}
")
CONFIGURE_FILE(
${
CMAKE_CURRENT_SOURCE_DIR
}
/libgit2.pc.in
${
CMAKE_CURRENT_BINARY_DIR
}
/libgit2.pc @ONLY)
IF (MSVC_IDE)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment