rugged 1.3.2.3 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/rugged/extconf.rb +1 -1
- data/ext/rugged/rugged_config.c +7 -2
- data/ext/rugged/rugged_remote.c +17 -0
- data/lib/rugged/version.rb +1 -1
- data/vendor/libgit2/CMakeLists.txt +103 -276
- data/vendor/libgit2/COPYING +36 -19
- data/vendor/libgit2/cmake/AddCFlagIfSupported.cmake +21 -21
- data/vendor/libgit2/cmake/DefaultCFlags.cmake +154 -0
- data/vendor/libgit2/cmake/EnableWarnings.cmake +13 -13
- data/vendor/libgit2/cmake/FindCoreFoundation.cmake +13 -13
- data/vendor/libgit2/cmake/FindGSSAPI.cmake +171 -287
- data/vendor/libgit2/cmake/FindGSSFramework.cmake +13 -13
- data/vendor/libgit2/cmake/{FindHTTP_Parser.cmake → FindHTTPParser.cmake} +17 -17
- data/vendor/libgit2/cmake/FindIconv.cmake +27 -27
- data/vendor/libgit2/cmake/FindLibSSH2.cmake +5 -5
- data/vendor/libgit2/cmake/FindPCRE.cmake +13 -13
- data/vendor/libgit2/cmake/FindPCRE2.cmake +12 -12
- data/vendor/libgit2/cmake/FindPkgLibraries.cmake +19 -19
- data/vendor/libgit2/cmake/FindSecurity.cmake +14 -14
- data/vendor/libgit2/cmake/FindStatNsec.cmake +12 -18
- data/vendor/libgit2/cmake/Findfutimens.cmake +8 -8
- data/vendor/libgit2/cmake/FindmbedTLS.cmake +63 -70
- data/vendor/libgit2/cmake/IdeSplitSources.cmake +18 -18
- data/vendor/libgit2/cmake/PkgBuildConfig.cmake +60 -60
- data/vendor/libgit2/cmake/SanitizeBool.cmake +20 -20
- data/vendor/libgit2/cmake/SelectGSSAPI.cmake +37 -37
- data/vendor/libgit2/cmake/SelectHTTPParser.cmake +19 -0
- data/vendor/libgit2/cmake/SelectHTTPSBackend.cmake +100 -100
- data/vendor/libgit2/cmake/SelectHashes.cmake +39 -49
- data/vendor/libgit2/cmake/SelectRegex.cmake +51 -0
- data/vendor/libgit2/cmake/SelectSSH.cmake +41 -0
- data/vendor/libgit2/cmake/SelectWinHTTP.cmake +17 -0
- data/vendor/libgit2/cmake/SelectZlib.cmake +34 -0
- data/vendor/libgit2/deps/chromium-zlib/CMakeLists.txt +6 -6
- data/vendor/libgit2/deps/ntlmclient/CMakeLists.txt +31 -31
- data/vendor/libgit2/deps/ntlmclient/crypt_openssl.c +1 -1
- data/vendor/libgit2/deps/ntlmclient/ntlm.c +4 -4
- data/vendor/libgit2/deps/ntlmclient/ntlm.h +4 -4
- data/vendor/libgit2/deps/ntlmclient/ntlmclient.h +2 -2
- data/vendor/libgit2/deps/pcre/CMakeLists.txt +88 -88
- data/vendor/libgit2/deps/winhttp/CMakeLists.txt +14 -16
- data/vendor/libgit2/deps/zlib/adler32.c +0 -7
- data/vendor/libgit2/deps/zlib/crc32.c +288 -975
- data/vendor/libgit2/deps/zlib/crc32.h +436 -9441
- data/vendor/libgit2/deps/zlib/deflate.c +31 -83
- data/vendor/libgit2/deps/zlib/deflate.h +15 -12
- data/vendor/libgit2/deps/zlib/gzguts.h +2 -3
- data/vendor/libgit2/deps/zlib/infback.c +1 -2
- data/vendor/libgit2/deps/zlib/inffast.c +14 -14
- data/vendor/libgit2/deps/zlib/inflate.c +8 -39
- data/vendor/libgit2/deps/zlib/inflate.h +2 -3
- data/vendor/libgit2/deps/zlib/inftrees.c +3 -3
- data/vendor/libgit2/deps/zlib/trees.c +48 -27
- data/vendor/libgit2/deps/zlib/zlib.h +100 -126
- data/vendor/libgit2/deps/zlib/zutil.c +2 -2
- data/vendor/libgit2/deps/zlib/zutil.h +9 -12
- data/vendor/libgit2/include/git2/apply.h +16 -2
- data/vendor/libgit2/include/git2/attr.h +11 -2
- data/vendor/libgit2/include/git2/blame.h +4 -1
- data/vendor/libgit2/include/git2/blob.h +14 -1
- data/vendor/libgit2/include/git2/branch.h +2 -0
- data/vendor/libgit2/include/git2/buffer.h +18 -78
- data/vendor/libgit2/include/git2/cert.h +2 -2
- data/vendor/libgit2/include/git2/checkout.h +5 -2
- data/vendor/libgit2/include/git2/clone.h +3 -3
- data/vendor/libgit2/include/git2/commit.h +2 -0
- data/vendor/libgit2/include/git2/common.h +5 -12
- data/vendor/libgit2/include/git2/config.h +19 -3
- data/vendor/libgit2/include/git2/credential.h +2 -1
- data/vendor/libgit2/include/git2/credential_helpers.h +1 -0
- data/vendor/libgit2/include/git2/deprecated.h +1 -1
- data/vendor/libgit2/include/git2/describe.h +7 -2
- data/vendor/libgit2/include/git2/diff.h +17 -9
- data/vendor/libgit2/include/git2/email.h +1 -1
- data/vendor/libgit2/include/git2/errors.h +1 -2
- data/vendor/libgit2/include/git2/filter.h +7 -2
- data/vendor/libgit2/include/git2/graph.h +1 -0
- data/vendor/libgit2/include/git2/ignore.h +1 -1
- data/vendor/libgit2/include/git2/index.h +11 -5
- data/vendor/libgit2/include/git2/indexer.h +19 -0
- data/vendor/libgit2/include/git2/merge.h +23 -3
- data/vendor/libgit2/include/git2/message.h +2 -0
- data/vendor/libgit2/include/git2/object.h +23 -0
- data/vendor/libgit2/include/git2/odb.h +37 -7
- data/vendor/libgit2/include/git2/odb_backend.h +1 -1
- data/vendor/libgit2/include/git2/pack.h +24 -8
- data/vendor/libgit2/include/git2/patch.h +8 -0
- data/vendor/libgit2/include/git2/pathspec.h +1 -1
- data/vendor/libgit2/include/git2/proxy.h +1 -1
- data/vendor/libgit2/include/git2/rebase.h +9 -1
- data/vendor/libgit2/include/git2/refdb.h +3 -0
- data/vendor/libgit2/include/git2/reflog.h +1 -1
- data/vendor/libgit2/include/git2/refs.h +2 -2
- data/vendor/libgit2/include/git2/remote.h +184 -37
- data/vendor/libgit2/include/git2/repository.h +14 -9
- data/vendor/libgit2/include/git2/reset.h +2 -2
- data/vendor/libgit2/include/git2/revparse.h +1 -1
- data/vendor/libgit2/include/git2/revwalk.h +4 -1
- data/vendor/libgit2/include/git2/signature.h +1 -1
- data/vendor/libgit2/include/git2/stash.h +3 -3
- data/vendor/libgit2/include/git2/status.h +9 -3
- data/vendor/libgit2/include/git2/submodule.h +7 -2
- data/vendor/libgit2/include/git2/sys/commit_graph.h +1 -1
- data/vendor/libgit2/include/git2/sys/odb_backend.h +2 -5
- data/vendor/libgit2/include/git2/sys/remote.h +31 -0
- data/vendor/libgit2/include/git2/sys/stream.h +1 -1
- data/vendor/libgit2/include/git2/sys/transport.h +25 -34
- data/vendor/libgit2/include/git2/tag.h +1 -0
- data/vendor/libgit2/include/git2/tree.h +4 -3
- data/vendor/libgit2/include/git2/types.h +7 -7
- data/vendor/libgit2/include/git2/version.h +3 -3
- data/vendor/libgit2/include/git2/worktree.h +12 -2
- data/vendor/libgit2/src/CMakeLists.txt +189 -315
- data/vendor/libgit2/src/annotated_commit.h +1 -1
- data/vendor/libgit2/src/apply.c +18 -18
- data/vendor/libgit2/src/apply.h +2 -2
- data/vendor/libgit2/src/attr.c +18 -18
- data/vendor/libgit2/src/attr_file.c +17 -17
- data/vendor/libgit2/src/attr_file.h +4 -4
- data/vendor/libgit2/src/attrcache.c +17 -12
- data/vendor/libgit2/src/blame_git.c +1 -1
- data/vendor/libgit2/src/blob.c +33 -26
- data/vendor/libgit2/src/blob.h +1 -1
- data/vendor/libgit2/src/branch.c +150 -109
- data/vendor/libgit2/src/branch.h +15 -3
- data/vendor/libgit2/src/buf.c +126 -0
- data/vendor/libgit2/src/buf.h +50 -0
- data/vendor/libgit2/src/cc-compat.h +1 -1
- data/vendor/libgit2/src/checkout.c +74 -68
- data/vendor/libgit2/src/cherrypick.c +10 -10
- data/vendor/libgit2/src/clone.c +66 -66
- data/vendor/libgit2/src/commit.c +128 -58
- data/vendor/libgit2/src/commit.h +24 -1
- data/vendor/libgit2/src/commit_graph.c +68 -53
- data/vendor/libgit2/src/commit_graph.h +10 -3
- data/vendor/libgit2/src/commit_list.c +2 -3
- data/vendor/libgit2/src/common.h +10 -3
- data/vendor/libgit2/src/config.c +99 -77
- data/vendor/libgit2/src/config.h +15 -2
- data/vendor/libgit2/src/config_file.c +103 -91
- data/vendor/libgit2/src/config_mem.c +9 -9
- data/vendor/libgit2/src/config_parse.c +27 -23
- data/vendor/libgit2/src/crlf.c +24 -21
- data/vendor/libgit2/src/date.c +10 -17
- data/vendor/libgit2/src/date.h +33 -0
- data/vendor/libgit2/src/describe.c +27 -19
- data/vendor/libgit2/src/diff.c +25 -8
- data/vendor/libgit2/src/diff.h +2 -4
- data/vendor/libgit2/src/diff_driver.c +34 -36
- data/vendor/libgit2/src/diff_driver.h +3 -3
- data/vendor/libgit2/src/diff_file.c +29 -20
- data/vendor/libgit2/src/diff_generate.c +30 -6
- data/vendor/libgit2/src/diff_generate.h +5 -3
- data/vendor/libgit2/src/diff_print.c +102 -95
- data/vendor/libgit2/src/diff_stats.c +40 -29
- data/vendor/libgit2/src/{message.h → diff_stats.h} +7 -6
- data/vendor/libgit2/src/diff_tform.c +9 -8
- data/vendor/libgit2/src/diff_xdiff.c +3 -8
- data/vendor/libgit2/src/email.c +54 -38
- data/vendor/libgit2/src/email.h +1 -1
- data/vendor/libgit2/src/errors.c +18 -18
- data/vendor/libgit2/src/features.h.in +6 -1
- data/vendor/libgit2/src/fetch.c +69 -24
- data/vendor/libgit2/src/fetch.h +1 -1
- data/vendor/libgit2/src/fetchhead.c +19 -19
- data/vendor/libgit2/src/filebuf.c +28 -28
- data/vendor/libgit2/src/filebuf.h +1 -1
- data/vendor/libgit2/src/filter.c +96 -52
- data/vendor/libgit2/src/filter.h +26 -5
- data/vendor/libgit2/src/fs_path.c +1912 -0
- data/vendor/libgit2/src/fs_path.h +752 -0
- data/vendor/libgit2/src/futils.c +91 -85
- data/vendor/libgit2/src/futils.h +26 -14
- data/vendor/libgit2/src/hash/sha1/collisiondetect.c +2 -2
- data/vendor/libgit2/src/hash/sha1/common_crypto.c +2 -2
- data/vendor/libgit2/src/hash/sha1/generic.c +2 -2
- data/vendor/libgit2/src/hash/sha1/mbedtls.c +2 -2
- data/vendor/libgit2/src/hash/sha1/openssl.c +2 -2
- data/vendor/libgit2/src/hash/sha1/sha1dc/sha1.c +1 -1
- data/vendor/libgit2/src/hash/sha1/win32.c +6 -6
- data/vendor/libgit2/src/hash/sha1.h +3 -1
- data/vendor/libgit2/src/hash.c +67 -35
- data/vendor/libgit2/src/hash.h +12 -12
- data/vendor/libgit2/src/ident.c +18 -18
- data/vendor/libgit2/src/ignore.c +35 -34
- data/vendor/libgit2/src/ignore.h +2 -2
- data/vendor/libgit2/src/index.c +79 -80
- data/vendor/libgit2/src/index.h +6 -3
- data/vendor/libgit2/src/indexer.c +75 -57
- data/vendor/libgit2/src/iterator.c +64 -56
- data/vendor/libgit2/src/iterator.h +5 -5
- data/vendor/libgit2/src/khash.h +1 -1
- data/vendor/libgit2/src/libgit2.c +22 -19
- data/vendor/libgit2/src/mailmap.c +38 -36
- data/vendor/libgit2/src/merge.c +27 -27
- data/vendor/libgit2/src/merge.h +1 -14
- data/vendor/libgit2/src/merge_driver.c +2 -2
- data/vendor/libgit2/src/merge_file.c +13 -3
- data/vendor/libgit2/src/message.c +21 -10
- data/vendor/libgit2/src/midx.c +83 -66
- data/vendor/libgit2/src/midx.h +3 -3
- data/vendor/libgit2/src/mwindow.c +1 -1
- data/vendor/libgit2/src/net.c +278 -68
- data/vendor/libgit2/src/net.h +10 -3
- data/vendor/libgit2/src/netops.c +1 -1
- data/vendor/libgit2/src/netops.h +1 -1
- data/vendor/libgit2/src/notes.c +20 -29
- data/vendor/libgit2/src/object.c +49 -9
- data/vendor/libgit2/src/object.h +1 -1
- data/vendor/libgit2/src/odb.c +35 -32
- data/vendor/libgit2/src/odb.h +1 -1
- data/vendor/libgit2/src/odb_loose.c +68 -68
- data/vendor/libgit2/src/odb_mempack.c +18 -5
- data/vendor/libgit2/src/odb_pack.c +43 -43
- data/vendor/libgit2/src/oid.c +11 -4
- data/vendor/libgit2/src/oid.h +15 -0
- data/vendor/libgit2/src/pack-objects.c +41 -26
- data/vendor/libgit2/src/pack-objects.h +11 -6
- data/vendor/libgit2/src/pack.c +10 -10
- data/vendor/libgit2/src/patch.c +3 -3
- data/vendor/libgit2/src/patch.h +1 -0
- data/vendor/libgit2/src/patch_generate.c +27 -11
- data/vendor/libgit2/src/patch_generate.h +5 -5
- data/vendor/libgit2/src/patch_parse.c +24 -24
- data/vendor/libgit2/src/path.c +76 -1951
- data/vendor/libgit2/src/path.h +34 -741
- data/vendor/libgit2/src/pathspec.c +6 -6
- data/vendor/libgit2/src/pathspec.h +2 -2
- data/vendor/libgit2/src/posix.c +3 -3
- data/vendor/libgit2/src/posix.h +1 -0
- data/vendor/libgit2/src/pqueue.h +1 -1
- data/vendor/libgit2/src/proxy.c +4 -1
- data/vendor/libgit2/src/proxy.h +1 -1
- data/vendor/libgit2/src/push.c +30 -35
- data/vendor/libgit2/src/push.h +4 -16
- data/vendor/libgit2/src/rand.c +226 -0
- data/vendor/libgit2/src/rand.h +37 -0
- data/vendor/libgit2/src/reader.c +8 -8
- data/vendor/libgit2/src/reader.h +2 -2
- data/vendor/libgit2/src/rebase.c +89 -88
- data/vendor/libgit2/src/refdb_fs.c +447 -173
- data/vendor/libgit2/src/refs.c +32 -32
- data/vendor/libgit2/src/refs.h +2 -2
- data/vendor/libgit2/src/refspec.c +32 -37
- data/vendor/libgit2/src/refspec.h +5 -2
- data/vendor/libgit2/src/regexp.c +1 -1
- data/vendor/libgit2/src/remote.c +713 -419
- data/vendor/libgit2/src/remote.h +15 -10
- data/vendor/libgit2/src/repository.c +350 -467
- data/vendor/libgit2/src/repository.h +11 -10
- data/vendor/libgit2/src/reset.c +8 -5
- data/vendor/libgit2/src/revert.c +10 -10
- data/vendor/libgit2/src/revparse.c +48 -35
- data/vendor/libgit2/src/revwalk.c +7 -7
- data/vendor/libgit2/src/signature.c +12 -6
- data/vendor/libgit2/src/signature.h +1 -1
- data/vendor/libgit2/src/sortedcache.c +1 -1
- data/vendor/libgit2/src/sortedcache.h +1 -1
- data/vendor/libgit2/src/stash.c +36 -37
- data/vendor/libgit2/src/status.c +4 -1
- data/vendor/libgit2/src/{buffer.c → str.c} +157 -151
- data/vendor/libgit2/src/str.h +357 -0
- data/vendor/libgit2/src/streams/mbedtls.c +8 -6
- data/vendor/libgit2/src/streams/openssl_dynamic.h +3 -3
- data/vendor/libgit2/src/submodule.c +171 -159
- data/vendor/libgit2/src/submodule.h +1 -1
- data/vendor/libgit2/src/sysdir.c +68 -52
- data/vendor/libgit2/src/sysdir.h +15 -10
- data/vendor/libgit2/src/tag.c +29 -27
- data/vendor/libgit2/src/thread.h +3 -3
- data/vendor/libgit2/src/threadstate.c +3 -3
- data/vendor/libgit2/src/threadstate.h +1 -1
- data/vendor/libgit2/src/trace.c +1 -14
- data/vendor/libgit2/src/trace.h +5 -22
- data/vendor/libgit2/src/trailer.c +1 -1
- data/vendor/libgit2/src/transaction.c +1 -1
- data/vendor/libgit2/src/transport.c +10 -10
- data/vendor/libgit2/src/transports/auth.c +7 -9
- data/vendor/libgit2/src/transports/auth.h +2 -3
- data/vendor/libgit2/src/transports/auth_negotiate.c +12 -13
- data/vendor/libgit2/src/transports/auth_ntlm.c +10 -10
- data/vendor/libgit2/src/transports/auth_ntlm.h +0 -1
- data/vendor/libgit2/src/transports/git.c +9 -11
- data/vendor/libgit2/src/transports/http.c +37 -17
- data/vendor/libgit2/src/transports/http.h +2 -3
- data/vendor/libgit2/src/transports/httpclient.c +65 -65
- data/vendor/libgit2/src/transports/local.c +124 -116
- data/vendor/libgit2/src/transports/smart.c +51 -139
- data/vendor/libgit2/src/transports/smart.h +25 -31
- data/vendor/libgit2/src/transports/smart_pkt.c +33 -33
- data/vendor/libgit2/src/transports/smart_protocol.c +57 -39
- data/vendor/libgit2/src/transports/ssh.c +47 -112
- data/vendor/libgit2/src/transports/winhttp.c +50 -56
- data/vendor/libgit2/src/tree-cache.c +5 -5
- data/vendor/libgit2/src/tree-cache.h +2 -2
- data/vendor/libgit2/src/tree.c +59 -48
- data/vendor/libgit2/src/tree.h +1 -1
- data/vendor/libgit2/src/unix/map.c +0 -2
- data/vendor/libgit2/src/unix/posix.h +1 -4
- data/vendor/libgit2/src/unix/realpath.c +0 -2
- data/vendor/libgit2/src/util.c +14 -14
- data/vendor/libgit2/src/util.h +2 -28
- data/vendor/libgit2/src/vector.h +1 -1
- data/vendor/libgit2/src/win32/findfile.c +172 -116
- data/vendor/libgit2/src/win32/findfile.h +7 -4
- data/vendor/libgit2/src/win32/path_w32.c +140 -9
- data/vendor/libgit2/src/win32/path_w32.h +2 -0
- data/vendor/libgit2/src/win32/posix.h +0 -1
- data/vendor/libgit2/src/win32/posix_w32.c +11 -27
- data/vendor/libgit2/src/win32/w32_buffer.c +2 -3
- data/vendor/libgit2/src/win32/w32_buffer.h +2 -3
- data/vendor/libgit2/src/win32/w32_leakcheck.c +1 -1
- data/vendor/libgit2/src/worktree.c +116 -94
- data/vendor/libgit2/src/worktree.h +1 -1
- data/vendor/libgit2/src/xdiff/git-xdiff.h +53 -0
- data/vendor/libgit2/src/xdiff/xdiff.h +15 -15
- data/vendor/libgit2/src/xdiff/xdiffi.c +134 -108
- data/vendor/libgit2/src/xdiff/xemit.c +23 -7
- data/vendor/libgit2/src/xdiff/xhistogram.c +87 -78
- data/vendor/libgit2/src/xdiff/xinclude.h +1 -12
- data/vendor/libgit2/src/xdiff/xmerge.c +104 -117
- data/vendor/libgit2/src/xdiff/xpatience.c +6 -17
- data/vendor/libgit2/src/xdiff/xprepare.c +15 -20
- data/vendor/libgit2/src/xdiff/xutils.c +18 -7
- data/vendor/libgit2/src/zstream.c +5 -5
- data/vendor/libgit2/src/zstream.h +4 -4
- metadata +25 -10
- data/vendor/libgit2/src/buffer.h +0 -374
|
@@ -1,95 +1,85 @@
|
|
|
1
1
|
add_library(git2internal OBJECT)
|
|
2
2
|
set_target_properties(git2internal PROPERTIES C_STANDARD 90)
|
|
3
|
+
set_target_properties(git2internal PROPERTIES C_EXTENSIONS OFF)
|
|
3
4
|
|
|
4
|
-
IF(DEBUG_POOL)
|
|
5
|
-
SET(GIT_DEBUG_POOL 1)
|
|
6
|
-
ENDIF()
|
|
7
|
-
ADD_FEATURE_INFO(debugpool GIT_DEBUG_POOL "debug pool allocator")
|
|
8
5
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
if(DEPRECATE_HARD)
|
|
7
|
+
add_definitions(-DGIT_DEPRECATE_HARD)
|
|
8
|
+
endif()
|
|
9
|
+
|
|
10
|
+
if(DEBUG_POOL)
|
|
11
|
+
set(GIT_DEBUG_POOL 1)
|
|
12
|
+
endif()
|
|
13
|
+
add_feature_info(debugpool GIT_DEBUG_POOL "debug pool allocator")
|
|
14
|
+
|
|
15
|
+
if(DEBUG_STRICT_ALLOC)
|
|
16
|
+
set(GIT_DEBUG_STRICT_ALLOC 1)
|
|
17
|
+
endif()
|
|
18
|
+
add_feature_info(debugalloc GIT_DEBUG_STRICT_ALLOC "debug strict allocators")
|
|
19
|
+
|
|
20
|
+
if(DEBUG_STRICT_OPEN)
|
|
21
|
+
set(GIT_DEBUG_STRICT_OPEN 1)
|
|
22
|
+
endif()
|
|
23
|
+
add_feature_info(debugopen GIT_DEBUG_STRICT_OPEN "path validation in open")
|
|
13
24
|
|
|
14
|
-
IF(DEBUG_STRICT_OPEN)
|
|
15
|
-
SET(GIT_DEBUG_STRICT_OPEN 1)
|
|
16
|
-
ENDIF()
|
|
17
|
-
ADD_FEATURE_INFO(debugopen GIT_DEBUG_STRICT_OPEN "path validation in open")
|
|
18
25
|
|
|
19
|
-
|
|
20
|
-
|
|
26
|
+
include(PkgBuildConfig)
|
|
27
|
+
include(SanitizeBool)
|
|
21
28
|
|
|
22
29
|
# This variable will contain the libraries we need to put into
|
|
23
30
|
# libgit2.pc's Requires.private. That is, what we're linking to or
|
|
24
31
|
# what someone who's statically linking us needs to link to.
|
|
25
|
-
|
|
32
|
+
set(LIBGIT2_PC_REQUIRES "")
|
|
26
33
|
# This will be set later if we use the system's http-parser library or
|
|
27
34
|
# use iconv (OSX) and will be written to the Libs.private field in the
|
|
28
35
|
# pc file.
|
|
29
|
-
|
|
36
|
+
set(LIBGIT2_PC_LIBS "")
|
|
30
37
|
|
|
31
|
-
|
|
38
|
+
set(LIBGIT2_INCLUDES
|
|
32
39
|
"${CMAKE_CURRENT_BINARY_DIR}"
|
|
33
|
-
"${
|
|
34
|
-
"${
|
|
35
|
-
SET(LIBGIT2_SYSTEM_INCLUDES "")
|
|
36
|
-
SET(LIBGIT2_LIBS "")
|
|
37
|
-
|
|
38
|
-
enable_warnings(missing-declarations)
|
|
39
|
-
|
|
40
|
-
# Enable tracing
|
|
41
|
-
IF(ENABLE_TRACE)
|
|
42
|
-
SET(GIT_TRACE 1)
|
|
43
|
-
ENDIF()
|
|
44
|
-
ADD_FEATURE_INFO(tracing GIT_TRACE "tracing support")
|
|
40
|
+
"${PROJECT_SOURCE_DIR}/src"
|
|
41
|
+
"${PROJECT_SOURCE_DIR}/include")
|
|
45
42
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
if(HAVE_FUTIMENS)
|
|
44
|
+
set(GIT_USE_FUTIMENS 1)
|
|
45
|
+
endif ()
|
|
46
|
+
add_feature_info(futimens GIT_USE_FUTIMENS "futimens support")
|
|
50
47
|
|
|
51
|
-
|
|
48
|
+
check_prototype_definition(qsort_r
|
|
52
49
|
"void qsort_r(void *base, size_t nmemb, size_t size, void *thunk, int (*compar)(void *, const void *, const void *))"
|
|
53
|
-
"" "stdlib.h"
|
|
54
|
-
IF (HAVE_QSORT_R_BSD)
|
|
55
|
-
target_compile_definitions(git2internal PRIVATE HAVE_QSORT_R_BSD)
|
|
56
|
-
ENDIF()
|
|
50
|
+
"" "stdlib.h" GIT_QSORT_R_BSD)
|
|
57
51
|
|
|
58
|
-
|
|
52
|
+
check_prototype_definition(qsort_r
|
|
59
53
|
"void qsort_r(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *, void *), void *arg)"
|
|
60
|
-
"" "stdlib.h"
|
|
61
|
-
IF (HAVE_QSORT_R_GNU)
|
|
62
|
-
target_compile_definitions(git2internal PRIVATE HAVE_QSORT_R_GNU)
|
|
63
|
-
ENDIF()
|
|
54
|
+
"" "stdlib.h" GIT_QSORT_R_GNU)
|
|
64
55
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
ENDIF ()
|
|
56
|
+
check_function_exists(qsort_s GIT_QSORT_S)
|
|
57
|
+
|
|
58
|
+
check_function_exists(getentropy GIT_RAND_GETENTROPY)
|
|
69
59
|
|
|
70
60
|
# Find required dependencies
|
|
71
61
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
62
|
+
if(WIN32)
|
|
63
|
+
list(APPEND LIBGIT2_SYSTEM_LIBS ws2_32)
|
|
64
|
+
elseif(CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)")
|
|
65
|
+
list(APPEND LIBGIT2_SYSTEM_LIBS socket nsl)
|
|
66
|
+
list(APPEND LIBGIT2_PC_LIBS "-lsocket" "-lnsl")
|
|
67
|
+
elseif(CMAKE_SYSTEM_NAME MATCHES "Haiku")
|
|
68
|
+
list(APPEND LIBGIT2_SYSTEM_LIBS network)
|
|
69
|
+
list(APPEND LIBGIT2_PC_LIBS "-lnetwork")
|
|
70
|
+
endif()
|
|
71
|
+
|
|
72
|
+
check_library_exists(rt clock_gettime "time.h" NEED_LIBRT)
|
|
73
|
+
if(NEED_LIBRT)
|
|
74
|
+
list(APPEND LIBGIT2_SYSTEM_LIBS rt)
|
|
75
|
+
list(APPEND LIBGIT2_PC_LIBS "-lrt")
|
|
76
|
+
endif()
|
|
77
|
+
|
|
78
|
+
if(USE_THREADS)
|
|
79
|
+
list(APPEND LIBGIT2_SYSTEM_LIBS ${CMAKE_THREAD_LIBS_INIT})
|
|
80
|
+
list(APPEND LIBGIT2_PC_LIBS ${CMAKE_THREAD_LIBS_INIT})
|
|
81
|
+
endif()
|
|
82
|
+
add_feature_info(threadsafe USE_THREADS "threadsafe support")
|
|
93
83
|
|
|
94
84
|
|
|
95
85
|
if(WIN32 AND EMBED_SSH_PATH)
|
|
@@ -102,218 +92,90 @@ if(WIN32 AND EMBED_SSH_PATH)
|
|
|
102
92
|
set(GIT_SSH 1)
|
|
103
93
|
endif()
|
|
104
94
|
|
|
105
|
-
IF (WIN32 AND WINHTTP)
|
|
106
|
-
SET(GIT_WINHTTP 1)
|
|
107
|
-
|
|
108
|
-
# Since MinGW does not come with headers or an import library for winhttp,
|
|
109
|
-
# we have to include a private header and generate our own import library
|
|
110
|
-
IF (MINGW)
|
|
111
|
-
ADD_SUBDIRECTORY("${libgit2_SOURCE_DIR}/deps/winhttp" "${libgit2_BINARY_DIR}/deps/winhttp")
|
|
112
|
-
LIST(APPEND LIBGIT2_LIBS winhttp)
|
|
113
|
-
LIST(APPEND LIBGIT2_INCLUDES "${libgit2_SOURCE_DIR}/deps/winhttp")
|
|
114
|
-
ELSE()
|
|
115
|
-
LIST(APPEND LIBGIT2_LIBS "winhttp")
|
|
116
|
-
LIST(APPEND LIBGIT2_PC_LIBS "-lwinhttp")
|
|
117
|
-
ENDIF ()
|
|
118
|
-
|
|
119
|
-
LIST(APPEND LIBGIT2_LIBS "rpcrt4" "crypt32" "ole32")
|
|
120
|
-
LIST(APPEND LIBGIT2_PC_LIBS "-lrpcrt4" "-lcrypt32" "-lole32")
|
|
121
|
-
ENDIF()
|
|
122
|
-
|
|
123
95
|
include(SelectHTTPSBackend)
|
|
124
96
|
include(SelectHashes)
|
|
97
|
+
include(SelectHTTPParser)
|
|
98
|
+
include(SelectRegex)
|
|
99
|
+
include(SelectSSH)
|
|
100
|
+
include(SelectWinHTTP)
|
|
101
|
+
include(SelectZlib)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
if(USE_SHA1 STREQUAL "CollisionDetection")
|
|
105
|
+
file(GLOB SRC_SHA1 hash/sha1/collisiondetect.* hash/sha1/sha1dc/*)
|
|
106
|
+
elseif(USE_SHA1 STREQUAL "OpenSSL")
|
|
107
|
+
file(GLOB SRC_SHA1 hash/sha1/openssl.*)
|
|
108
|
+
elseif(USE_SHA1 STREQUAL "CommonCrypto")
|
|
109
|
+
file(GLOB SRC_SHA1 hash/sha1/common_crypto.*)
|
|
110
|
+
elseif(USE_SHA1 STREQUAL "mbedTLS")
|
|
111
|
+
file(GLOB SRC_SHA1 hash/sha1/mbedtls.*)
|
|
112
|
+
elseif(USE_SHA1 STREQUAL "Win32")
|
|
113
|
+
file(GLOB SRC_SHA1 hash/sha1/win32.*)
|
|
114
|
+
elseif(USE_SHA1 STREQUAL "Generic")
|
|
115
|
+
file(GLOB SRC_SHA1 hash/sha1/generic.*)
|
|
116
|
+
endif()
|
|
117
|
+
list(APPEND SRC_SHA1 "hash/sha1.h")
|
|
125
118
|
target_sources(git2internal PRIVATE ${SRC_SHA1})
|
|
126
119
|
|
|
127
|
-
# Specify regular expression implementation
|
|
128
|
-
FIND_PACKAGE(PCRE)
|
|
129
|
-
|
|
130
|
-
IF(REGEX_BACKEND STREQUAL "")
|
|
131
|
-
CHECK_SYMBOL_EXISTS(regcomp_l "regex.h;xlocale.h" HAVE_REGCOMP_L)
|
|
132
|
-
|
|
133
|
-
IF(HAVE_REGCOMP_L)
|
|
134
|
-
SET(REGEX_BACKEND "regcomp_l")
|
|
135
|
-
ELSEIF(PCRE_FOUND)
|
|
136
|
-
SET(REGEX_BACKEND "pcre")
|
|
137
|
-
ELSE()
|
|
138
|
-
SET(REGEX_BACKEND "builtin")
|
|
139
|
-
ENDIF()
|
|
140
|
-
ENDIF()
|
|
141
|
-
|
|
142
|
-
IF(REGEX_BACKEND STREQUAL "regcomp_l")
|
|
143
|
-
ADD_FEATURE_INFO(regex ON "using system regcomp_l")
|
|
144
|
-
SET(GIT_REGEX_REGCOMP_L 1)
|
|
145
|
-
ELSEIF(REGEX_BACKEND STREQUAL "pcre2")
|
|
146
|
-
FIND_PACKAGE(PCRE2)
|
|
147
|
-
|
|
148
|
-
IF(NOT PCRE2_FOUND)
|
|
149
|
-
MESSAGE(FATAL_ERROR "PCRE2 support was requested but not found")
|
|
150
|
-
ENDIF()
|
|
151
|
-
|
|
152
|
-
ADD_FEATURE_INFO(regex ON "using system PCRE2")
|
|
153
|
-
SET(GIT_REGEX_PCRE2 1)
|
|
154
|
-
|
|
155
|
-
LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${PCRE2_INCLUDE_DIRS})
|
|
156
|
-
LIST(APPEND LIBGIT2_LIBS ${PCRE2_LIBRARIES})
|
|
157
|
-
LIST(APPEND LIBGIT2_PC_REQUIRES "libpcre2-8")
|
|
158
|
-
ELSEIF(REGEX_BACKEND STREQUAL "pcre")
|
|
159
|
-
ADD_FEATURE_INFO(regex ON "using system PCRE")
|
|
160
|
-
SET(GIT_REGEX_PCRE 1)
|
|
161
|
-
|
|
162
|
-
LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${PCRE_INCLUDE_DIRS})
|
|
163
|
-
LIST(APPEND LIBGIT2_LIBS ${PCRE_LIBRARIES})
|
|
164
|
-
LIST(APPEND LIBGIT2_PC_REQUIRES "libpcre")
|
|
165
|
-
ELSEIF(REGEX_BACKEND STREQUAL "regcomp")
|
|
166
|
-
ADD_FEATURE_INFO(regex ON "using system regcomp")
|
|
167
|
-
SET(GIT_REGEX_REGCOMP 1)
|
|
168
|
-
ELSEIF(REGEX_BACKEND STREQUAL "builtin")
|
|
169
|
-
ADD_FEATURE_INFO(regex ON "using bundled PCRE")
|
|
170
|
-
SET(GIT_REGEX_BUILTIN 1)
|
|
171
|
-
|
|
172
|
-
ADD_SUBDIRECTORY("${libgit2_SOURCE_DIR}/deps/pcre" "${libgit2_BINARY_DIR}/deps/pcre")
|
|
173
|
-
LIST(APPEND LIBGIT2_INCLUDES "${libgit2_SOURCE_DIR}/deps/pcre")
|
|
174
|
-
LIST(APPEND LIBGIT2_OBJECTS $<TARGET_OBJECTS:pcre>)
|
|
175
|
-
ELSE()
|
|
176
|
-
MESSAGE(FATAL_ERROR "The REGEX_BACKEND option provided is not supported")
|
|
177
|
-
ENDIF()
|
|
178
|
-
|
|
179
|
-
# Optional external dependency: http-parser
|
|
180
|
-
IF(USE_HTTP_PARSER STREQUAL "system")
|
|
181
|
-
FIND_PACKAGE(HTTP_Parser)
|
|
182
|
-
|
|
183
|
-
IF (HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUAL 2)
|
|
184
|
-
LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${HTTP_PARSER_INCLUDE_DIRS})
|
|
185
|
-
LIST(APPEND LIBGIT2_LIBS ${HTTP_PARSER_LIBRARIES})
|
|
186
|
-
LIST(APPEND LIBGIT2_PC_LIBS "-lhttp_parser")
|
|
187
|
-
ADD_FEATURE_INFO(http-parser ON "http-parser support (system)")
|
|
188
|
-
ELSE()
|
|
189
|
-
MESSAGE(FATAL_ERROR "http-parser support was requested but not found")
|
|
190
|
-
ENDIF()
|
|
191
|
-
ELSE()
|
|
192
|
-
MESSAGE(STATUS "http-parser version 2 was not found or disabled; using bundled 3rd-party sources.")
|
|
193
|
-
ADD_SUBDIRECTORY("${libgit2_SOURCE_DIR}/deps/http-parser" "${libgit2_BINARY_DIR}/deps/http-parser")
|
|
194
|
-
LIST(APPEND LIBGIT2_INCLUDES "${libgit2_SOURCE_DIR}/deps/http-parser")
|
|
195
|
-
LIST(APPEND LIBGIT2_OBJECTS "$<TARGET_OBJECTS:http-parser>")
|
|
196
|
-
ADD_FEATURE_INFO(http-parser ON "http-parser support (bundled)")
|
|
197
|
-
ENDIF()
|
|
198
|
-
|
|
199
|
-
# Optional external dependency: zlib
|
|
200
|
-
SanitizeBool(USE_BUNDLED_ZLIB)
|
|
201
|
-
IF(USE_BUNDLED_ZLIB STREQUAL ON)
|
|
202
|
-
SET(USE_BUNDLED_ZLIB "Bundled")
|
|
203
|
-
ENDIF()
|
|
204
|
-
|
|
205
|
-
IF(USE_BUNDLED_ZLIB STREQUAL "OFF")
|
|
206
|
-
FIND_PACKAGE(ZLIB)
|
|
207
|
-
IF(ZLIB_FOUND)
|
|
208
|
-
LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${ZLIB_INCLUDE_DIRS})
|
|
209
|
-
LIST(APPEND LIBGIT2_LIBS ${ZLIB_LIBRARIES})
|
|
210
|
-
IF(APPLE OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
|
211
|
-
LIST(APPEND LIBGIT2_PC_LIBS "-lz")
|
|
212
|
-
ELSE()
|
|
213
|
-
LIST(APPEND LIBGIT2_PC_REQUIRES "zlib")
|
|
214
|
-
ENDIF()
|
|
215
|
-
ADD_FEATURE_INFO(zlib ON "using system zlib")
|
|
216
|
-
ELSE()
|
|
217
|
-
MESSAGE(STATUS "zlib was not found; using bundled 3rd-party sources." )
|
|
218
|
-
ENDIF()
|
|
219
|
-
ENDIF()
|
|
220
|
-
IF(USE_BUNDLED_ZLIB STREQUAL "Chromium")
|
|
221
|
-
ADD_SUBDIRECTORY("${libgit2_SOURCE_DIR}/deps/chromium-zlib" "${libgit2_BINARY_DIR}/deps/chromium-zlib")
|
|
222
|
-
LIST(APPEND LIBGIT2_INCLUDES "${libgit2_SOURCE_DIR}/deps/chromium-zlib")
|
|
223
|
-
LIST(APPEND LIBGIT2_OBJECTS $<TARGET_OBJECTS:chromium_zlib>)
|
|
224
|
-
ADD_FEATURE_INFO(zlib ON "using (Chromium) bundled zlib")
|
|
225
|
-
ELSEIF(USE_BUNDLED_ZLIB OR NOT ZLIB_FOUND)
|
|
226
|
-
ADD_SUBDIRECTORY("${libgit2_SOURCE_DIR}/deps/zlib" "${libgit2_BINARY_DIR}/deps/zlib")
|
|
227
|
-
LIST(APPEND LIBGIT2_INCLUDES "${libgit2_SOURCE_DIR}/deps/zlib")
|
|
228
|
-
LIST(APPEND LIBGIT2_OBJECTS $<TARGET_OBJECTS:zlib>)
|
|
229
|
-
ADD_FEATURE_INFO(zlib ON "using bundled zlib")
|
|
230
|
-
ENDIF()
|
|
231
|
-
|
|
232
|
-
# Optional external dependency: libssh2
|
|
233
|
-
IF (USE_SSH)
|
|
234
|
-
FIND_PKGLIBRARIES(LIBSSH2 libssh2)
|
|
235
|
-
IF (NOT LIBSSH2_FOUND)
|
|
236
|
-
FIND_PACKAGE(LibSSH2)
|
|
237
|
-
SET(LIBSSH2_INCLUDE_DIRS ${LIBSSH2_INCLUDE_DIR})
|
|
238
|
-
GET_FILENAME_COMPONENT(LIBSSH2_LIBRARY_DIRS "${LIBSSH2_LIBRARY}" DIRECTORY)
|
|
239
|
-
SET(LIBSSH2_LIBRARIES ${LIBSSH2_LIBRARY})
|
|
240
|
-
SET(LIBSSH2_LDFLAGS "-lssh2")
|
|
241
|
-
ENDIF()
|
|
242
|
-
ENDIF()
|
|
243
|
-
IF (LIBSSH2_FOUND)
|
|
244
|
-
SET(GIT_SSH 1)
|
|
245
|
-
LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${LIBSSH2_INCLUDE_DIRS})
|
|
246
|
-
LIST(APPEND LIBGIT2_LIBS ${LIBSSH2_LIBRARIES})
|
|
247
|
-
LIST(APPEND LIBGIT2_PC_LIBS ${LIBSSH2_LDFLAGS})
|
|
248
|
-
|
|
249
|
-
CHECK_LIBRARY_EXISTS("${LIBSSH2_LIBRARIES}" libssh2_userauth_publickey_frommemory "${LIBSSH2_LIBRARY_DIRS}" HAVE_LIBSSH2_MEMORY_CREDENTIALS)
|
|
250
|
-
IF (HAVE_LIBSSH2_MEMORY_CREDENTIALS)
|
|
251
|
-
SET(GIT_SSH_MEMORY_CREDENTIALS 1)
|
|
252
|
-
ENDIF()
|
|
253
|
-
ELSE()
|
|
254
|
-
MESSAGE(STATUS "LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.")
|
|
255
|
-
ENDIF()
|
|
256
|
-
ADD_FEATURE_INFO(SSH GIT_SSH "SSH transport support")
|
|
257
|
-
|
|
258
120
|
# Optional external dependency: ntlmclient
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
121
|
+
if(USE_NTLMCLIENT)
|
|
122
|
+
set(GIT_NTLM 1)
|
|
123
|
+
add_subdirectory("${PROJECT_SOURCE_DIR}/deps/ntlmclient" "${PROJECT_BINARY_DIR}/deps/ntlmclient")
|
|
124
|
+
list(APPEND LIBGIT2_DEPENDENCY_INCLUDES "${PROJECT_SOURCE_DIR}/deps/ntlmclient")
|
|
125
|
+
list(APPEND LIBGIT2_DEPENDENCY_OBJECTS "$<TARGET_OBJECTS:ntlmclient>")
|
|
126
|
+
endif()
|
|
127
|
+
add_feature_info(ntlmclient GIT_NTLM "NTLM authentication support for Unix")
|
|
266
128
|
|
|
267
129
|
# Optional external dependency: GSSAPI
|
|
268
130
|
|
|
269
|
-
|
|
131
|
+
include(SelectGSSAPI)
|
|
270
132
|
|
|
271
133
|
# Optional external dependency: iconv
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
134
|
+
if(USE_ICONV)
|
|
135
|
+
find_package(Iconv)
|
|
136
|
+
endif()
|
|
137
|
+
if(ICONV_FOUND)
|
|
138
|
+
set(GIT_USE_ICONV 1)
|
|
139
|
+
list(APPEND LIBGIT2_SYSTEM_INCLUDES ${ICONV_INCLUDE_DIR})
|
|
140
|
+
list(APPEND LIBGIT2_SYSTEM_LIBS ${ICONV_LIBRARIES})
|
|
141
|
+
list(APPEND LIBGIT2_PC_LIBS ${ICONV_LIBRARIES})
|
|
142
|
+
endif()
|
|
143
|
+
add_feature_info(iconv GIT_USE_ICONV "iconv encoding conversion support")
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
if(USE_THREADS)
|
|
147
|
+
if(NOT WIN32)
|
|
148
|
+
find_package(Threads REQUIRED)
|
|
149
|
+
endif()
|
|
150
|
+
|
|
151
|
+
set(GIT_THREADS 1)
|
|
152
|
+
endif()
|
|
153
|
+
|
|
154
|
+
if(USE_NSEC)
|
|
155
|
+
set(GIT_USE_NSEC 1)
|
|
156
|
+
endif()
|
|
157
|
+
|
|
158
|
+
if(HAVE_STRUCT_STAT_ST_MTIM)
|
|
159
|
+
set(GIT_USE_STAT_MTIM 1)
|
|
160
|
+
elseif(HAVE_STRUCT_STAT_ST_MTIMESPEC)
|
|
161
|
+
set(GIT_USE_STAT_MTIMESPEC 1)
|
|
162
|
+
elseif(HAVE_STRUCT_STAT_ST_MTIME_NSEC)
|
|
163
|
+
set(GIT_USE_STAT_MTIME_NSEC 1)
|
|
164
|
+
endif()
|
|
303
165
|
|
|
304
166
|
target_compile_definitions(git2internal PRIVATE _FILE_OFFSET_BITS=64)
|
|
305
167
|
|
|
306
168
|
# Collect sourcefiles
|
|
307
169
|
file(GLOB SRC_H
|
|
308
|
-
"${
|
|
309
|
-
"${
|
|
310
|
-
"${
|
|
170
|
+
"${PROJECT_SOURCE_DIR}/include/git2.h"
|
|
171
|
+
"${PROJECT_SOURCE_DIR}/include/git2/*.h"
|
|
172
|
+
"${PROJECT_SOURCE_DIR}/include/git2/sys/*.h")
|
|
311
173
|
list(SORT SRC_H)
|
|
312
174
|
target_sources(git2internal PRIVATE ${SRC_H})
|
|
313
175
|
|
|
314
176
|
# On Windows use specific platform sources
|
|
315
177
|
if(WIN32 AND NOT CYGWIN)
|
|
316
|
-
|
|
178
|
+
set(WIN_RC "win32/git2.rc")
|
|
317
179
|
|
|
318
180
|
file(GLOB SRC_OS win32/*.c win32/*.h)
|
|
319
181
|
list(SORT SRC_OS)
|
|
@@ -326,9 +188,9 @@ else()
|
|
|
326
188
|
target_sources(git2internal PRIVATE ${SRC_OS})
|
|
327
189
|
endif()
|
|
328
190
|
|
|
329
|
-
|
|
191
|
+
if(USE_LEAK_CHECKER STREQUAL "valgrind")
|
|
330
192
|
target_compile_definitions(git2internal PRIVATE VALGRIND)
|
|
331
|
-
|
|
193
|
+
endif()
|
|
332
194
|
|
|
333
195
|
file(GLOB SRC_GIT2 *.c *.h
|
|
334
196
|
allocators/*.c allocators/*.h
|
|
@@ -338,65 +200,77 @@ file(GLOB SRC_GIT2 *.c *.h
|
|
|
338
200
|
list(SORT SRC_GIT2)
|
|
339
201
|
target_sources(git2internal PRIVATE ${SRC_GIT2})
|
|
340
202
|
|
|
341
|
-
|
|
203
|
+
if(APPLE)
|
|
342
204
|
# The old Secure Transport API has been deprecated in macOS 10.15.
|
|
343
|
-
|
|
344
|
-
|
|
205
|
+
set_source_files_properties(streams/stransport.c PROPERTIES COMPILE_FLAGS -Wno-deprecated)
|
|
206
|
+
endif()
|
|
345
207
|
|
|
346
208
|
# the xdiff dependency is not (yet) warning-free, disable warnings as
|
|
347
209
|
# errors for the xdiff sources until we've sorted them out
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
210
|
+
if(MSVC)
|
|
211
|
+
set_source_files_properties(xdiff/xdiffi.c PROPERTIES COMPILE_FLAGS -WX-)
|
|
212
|
+
set_source_files_properties(xdiff/xemit.c PROPERTIES COMPILE_FLAGS -WX-)
|
|
213
|
+
set_source_files_properties(xdiff/xhistogram.c PROPERTIES COMPILE_FLAGS -WX-)
|
|
214
|
+
set_source_files_properties(xdiff/xmerge.c PROPERTIES COMPILE_FLAGS -WX-)
|
|
215
|
+
set_source_files_properties(xdiff/xutils.c PROPERTIES COMPILE_FLAGS -WX-)
|
|
216
|
+
set_source_files_properties(xdiff/xpatience.c PROPERTIES COMPILE_FLAGS -WX-)
|
|
217
|
+
else()
|
|
218
|
+
set_source_files_properties(xdiff/xdiffi.c PROPERTIES COMPILE_FLAGS "-Wno-sign-compare -Wno-unused-parameter")
|
|
219
|
+
set_source_files_properties(xdiff/xemit.c PROPERTIES COMPILE_FLAGS "-Wno-sign-compare -Wno-unused-parameter")
|
|
220
|
+
set_source_files_properties(xdiff/xhistogram.c PROPERTIES COMPILE_FLAGS "-Wno-sign-compare")
|
|
221
|
+
set_source_files_properties(xdiff/xutils.c PROPERTIES COMPILE_FLAGS "-Wno-sign-compare")
|
|
222
|
+
set_source_files_properties(xdiff/xpatience.c PROPERTIES COMPILE_FLAGS "-Wno-sign-compare")
|
|
223
|
+
endif()
|
|
352
224
|
|
|
353
225
|
# Determine architecture of the machine
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
226
|
+
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
227
|
+
set(GIT_ARCH_64 1)
|
|
228
|
+
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
|
229
|
+
set(GIT_ARCH_32 1)
|
|
230
|
+
elseif(CMAKE_SIZEOF_VOID_P)
|
|
231
|
+
message(FATAL_ERROR "Unsupported architecture (pointer size is ${CMAKE_SIZEOF_VOID_P} bytes)")
|
|
232
|
+
else()
|
|
233
|
+
message(FATAL_ERROR "Unsupported architecture (CMAKE_SIZEOF_VOID_P is unset)")
|
|
234
|
+
endif()
|
|
235
|
+
|
|
236
|
+
configure_file(features.h.in git2/sys/features.h)
|
|
237
|
+
|
|
238
|
+
ide_split_sources(git2internal)
|
|
239
|
+
list(APPEND LIBGIT2_OBJECTS $<TARGET_OBJECTS:git2internal> ${LIBGIT2_DEPENDENCY_OBJECTS})
|
|
240
|
+
|
|
241
|
+
target_include_directories(git2internal PRIVATE ${LIBGIT2_INCLUDES} ${LIBGIT2_DEPENDENCY_INCLUDES} PUBLIC ${PROJECT_SOURCE_DIR}/include)
|
|
242
|
+
target_include_directories(git2internal SYSTEM PRIVATE ${LIBGIT2_SYSTEM_INCLUDES})
|
|
243
|
+
|
|
244
|
+
set(LIBGIT2_INCLUDES ${LIBGIT2_INCLUDES} PARENT_SCOPE)
|
|
245
|
+
set(LIBGIT2_OBJECTS ${LIBGIT2_OBJECTS} PARENT_SCOPE)
|
|
246
|
+
set(LIBGIT2_DEPENDENCY_INCLUDES ${LIBGIT2_DEPENDENCY_INCLUDES} PARENT_SCOPE)
|
|
247
|
+
set(LIBGIT2_DEPENDENCY_OBJECTS ${LIBGIT2_DEPENDENCY_OBJECTS} PARENT_SCOPE)
|
|
248
|
+
set(LIBGIT2_SYSTEM_INCLUDES ${LIBGIT2_SYSTEM_INCLUDES} PARENT_SCOPE)
|
|
249
|
+
set(LIBGIT2_SYSTEM_LIBS ${LIBGIT2_SYSTEM_LIBS} PARENT_SCOPE)
|
|
250
|
+
|
|
251
|
+
if(XCODE_VERSION)
|
|
378
252
|
# This is required for Xcode to actually link the libgit2 library
|
|
379
253
|
# when using only object libraries.
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
254
|
+
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/dummy.c "")
|
|
255
|
+
list(APPEND LIBGIT2_OBJECTS ${CMAKE_CURRENT_BINARY_DIR}/dummy.c)
|
|
256
|
+
endif()
|
|
383
257
|
|
|
384
258
|
# Compile and link libgit2
|
|
385
|
-
|
|
386
|
-
|
|
259
|
+
add_library(git2 ${WIN_RC} ${LIBGIT2_OBJECTS})
|
|
260
|
+
target_link_libraries(git2 ${LIBGIT2_SYSTEM_LIBS})
|
|
387
261
|
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
262
|
+
set_target_properties(git2 PROPERTIES C_STANDARD 90)
|
|
263
|
+
set_target_properties(git2 PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
|
|
264
|
+
set_target_properties(git2 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
|
|
265
|
+
set_target_properties(git2 PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
|
|
392
266
|
|
|
393
267
|
# Workaround for Cmake bug #0011240 (see http://public.kitware.com/Bug/view.php?id=11240)
|
|
394
268
|
# Win64+MSVC+static libs = linker error
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
269
|
+
if(MSVC AND GIT_ARCH_64 AND NOT BUILD_SHARED_LIBS)
|
|
270
|
+
set_target_properties(git2 PROPERTIES STATIC_LIBRARY_FLAGS "/MACHINE:x64")
|
|
271
|
+
endif()
|
|
398
272
|
|
|
399
|
-
|
|
273
|
+
ide_split_sources(git2)
|
|
400
274
|
|
|
401
275
|
if(SONAME)
|
|
402
276
|
set_target_properties(git2 PROPERTIES VERSION ${libgit2_VERSION})
|
|
@@ -409,7 +283,7 @@ if(SONAME)
|
|
|
409
283
|
endif()
|
|
410
284
|
endif()
|
|
411
285
|
|
|
412
|
-
|
|
286
|
+
pkg_build_config(NAME libgit2
|
|
413
287
|
VERSION ${libgit2_VERSION}
|
|
414
288
|
DESCRIPTION "The git library, take 2"
|
|
415
289
|
LIBS_SELF git2
|
|
@@ -417,17 +291,17 @@ PKG_BUILD_CONFIG(NAME libgit2
|
|
|
417
291
|
REQUIRES ${LIBGIT2_PC_REQUIRES}
|
|
418
292
|
)
|
|
419
293
|
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
294
|
+
if(MSVC_IDE)
|
|
295
|
+
# Precompiled headers
|
|
296
|
+
set_target_properties(git2 PROPERTIES COMPILE_FLAGS "/Yuprecompiled.h /FIprecompiled.h")
|
|
297
|
+
set_source_files_properties(win32/precompiled.c COMPILE_FLAGS "/Ycprecompiled.h")
|
|
298
|
+
endif()
|
|
425
299
|
|
|
426
300
|
# Install
|
|
427
|
-
|
|
301
|
+
install(TARGETS git2
|
|
428
302
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
429
303
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
430
304
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
431
305
|
)
|
|
432
|
-
|
|
433
|
-
|
|
306
|
+
install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/git2 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
|
307
|
+
install(FILES ${PROJECT_SOURCE_DIR}/include/git2.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|