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
604e2811
Unverified
Commit
604e2811
authored
May 02, 2019
by
Patrick Steinhardt
Committed by
GitHub
May 02, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5063 from pks-t/pks/cmake-regcomp-fix
cmake: correctly detect if system provides `regcomp`
parents
957940bf
ee3d71fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
+15
-10
src/CMakeLists.txt
+15
-10
No files found.
src/CMakeLists.txt
View file @
604e2811
...
...
@@ -48,11 +48,23 @@ IF (ENABLE_TRACE STREQUAL "ON")
ENDIF
()
ADD_FEATURE_INFO
(
tracing GIT_TRACE
"tracing support"
)
# Use `regcomp_l` if available
CHECK_SYMBOL_EXISTS
(
regcomp_l
"regex.h;xlocale.h"
HAVE_REGCOMP_L
)
IF
(
HAVE_REGCOMP_L
)
SET
(
GIT_USE_REGCOMP_L 1
)
ENDIF
()
# Otherwise, we either want to use system's `regcomp` or our
# bundled regcomp code, if system doesn't provide `regcomp`.
IF
(
NOT HAVE_REGCOMP_L
)
CHECK_FUNCTION_EXISTS
(
regcomp HAVE_REGCOMP
)
IF
(
NOT HAVE_REGCOMP
)
ADD_SUBDIRECTORY
(
"
${
libgit2_SOURCE_DIR
}
/deps/regex"
"
${
libgit2_BINARY_DIR
}
/deps/regex"
)
LIST
(
APPEND LIBGIT2_INCLUDES
"
${
libgit2_SOURCE_DIR
}
/deps/regex"
)
LIST
(
APPEND LIBGIT2_OBJECTS $<TARGET_OBJECTS:regex>
)
ENDIF
()
ENDIF
()
CHECK_FUNCTION_EXISTS
(
futimens HAVE_FUTIMENS
)
IF
(
HAVE_FUTIMENS
)
SET
(
GIT_USE_FUTIMENS 1
)
...
...
@@ -117,7 +129,7 @@ IF (WIN32 AND WINHTTP)
IF
(
MINGW
)
ADD_SUBDIRECTORY
(
"
${
libgit2_SOURCE_DIR
}
/deps/winhttp"
"
${
libgit2_BINARY_DIR
}
/deps/winhttp"
)
LIST
(
APPEND LIBGIT2_LIBS winhttp
)
LIST
(
APPEND LIBGIT2_
SYSTEM_
INCLUDES
"
${
libgit2_SOURCE_DIR
}
/deps/winhttp"
)
LIST
(
APPEND LIBGIT2_INCLUDES
"
${
libgit2_SOURCE_DIR
}
/deps/winhttp"
)
ELSE
()
LIST
(
APPEND LIBGIT2_LIBS
"winhttp"
)
LIST
(
APPEND LIBGIT2_PC_LIBS
"-lwinhttp"
)
...
...
@@ -294,13 +306,6 @@ ELSE()
MESSAGE(FATAL_ERROR "
Asked for unknown SHA1 backend
${
SHA1_BACKEND
}
")
ENDIF()
# Include POSIX regex when it is required
IF(WIN32 OR AMIGA OR CMAKE_SYSTEM_NAME MATCHES "
(
Solaris|SunOS
)
")
ADD_SUBDIRECTORY("
${
libgit2_SOURCE_DIR
}
/deps/regex
" "
${
libgit2_BINARY_DIR
}
/deps/regex
")
LIST(APPEND LIBGIT2_SYSTEM_INCLUDES "
${
libgit2_SOURCE_DIR
}
/deps/regex
")
LIST(APPEND LIBGIT2_OBJECTS $<TARGET_OBJECTS:regex>)
ENDIF()
# Optional external dependency: http-parser
FIND_PACKAGE(HTTP_Parser)
IF (USE_EXT_HTTP_PARSER AND HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUAL 2)
...
...
@@ -311,7 +316,7 @@ IF (USE_EXT_HTTP_PARSER AND HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUA
ELSE()
MESSAGE(STATUS "
http-parser version 2 was not found or disabled; using bundled 3rd-party sources.
")
ADD_SUBDIRECTORY("
${
libgit2_SOURCE_DIR
}
/deps/http-parser
" "
${
libgit2_BINARY_DIR
}
/deps/http-parser
")
LIST(APPEND LIBGIT2_
SYSTEM_
INCLUDES "
${
libgit2_SOURCE_DIR
}
/deps/http-parser
")
LIST(APPEND LIBGIT2_INCLUDES "
${
libgit2_SOURCE_DIR
}
/deps/http-parser
")
LIST(APPEND LIBGIT2_OBJECTS "
$<TARGET_OBJECTS:http-parser>
")
ADD_FEATURE_INFO(http-parser ON "
http-parser
support
(
bundled
)
")
ENDIF()
...
...
@@ -335,7 +340,7 @@ IF(NOT USE_BUNDLED_ZLIB)
ENDIF()
IF(USE_BUNDLED_ZLIB OR NOT ZLIB_FOUND)
ADD_SUBDIRECTORY("
${
libgit2_SOURCE_DIR
}
/deps/zlib
" "
${
libgit2_BINARY_DIR
}
/deps/zlib
")
LIST(APPEND LIBGIT2_
SYSTEM_
INCLUDES "
${
libgit2_SOURCE_DIR
}
/deps/zlib
")
LIST(APPEND LIBGIT2_INCLUDES "
${
libgit2_SOURCE_DIR
}
/deps/zlib
")
LIST(APPEND LIBGIT2_OBJECTS $<TARGET_OBJECTS:zlib>)
ADD_FEATURE_INFO(zlib ON "
using bundled zlib
")
ENDIF()
...
...
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