rugged 1.3.2.3 → 1.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (329) hide show
  1. checksums.yaml +4 -4
  2. data/ext/rugged/extconf.rb +1 -1
  3. data/ext/rugged/rugged_config.c +7 -2
  4. data/ext/rugged/rugged_remote.c +17 -0
  5. data/lib/rugged/version.rb +1 -1
  6. data/vendor/libgit2/CMakeLists.txt +103 -276
  7. data/vendor/libgit2/COPYING +36 -19
  8. data/vendor/libgit2/cmake/AddCFlagIfSupported.cmake +21 -21
  9. data/vendor/libgit2/cmake/DefaultCFlags.cmake +154 -0
  10. data/vendor/libgit2/cmake/EnableWarnings.cmake +13 -13
  11. data/vendor/libgit2/cmake/FindCoreFoundation.cmake +13 -13
  12. data/vendor/libgit2/cmake/FindGSSAPI.cmake +171 -287
  13. data/vendor/libgit2/cmake/FindGSSFramework.cmake +13 -13
  14. data/vendor/libgit2/cmake/{FindHTTP_Parser.cmake → FindHTTPParser.cmake} +17 -17
  15. data/vendor/libgit2/cmake/FindIconv.cmake +27 -27
  16. data/vendor/libgit2/cmake/FindLibSSH2.cmake +5 -5
  17. data/vendor/libgit2/cmake/FindPCRE.cmake +13 -13
  18. data/vendor/libgit2/cmake/FindPCRE2.cmake +12 -12
  19. data/vendor/libgit2/cmake/FindPkgLibraries.cmake +19 -19
  20. data/vendor/libgit2/cmake/FindSecurity.cmake +14 -14
  21. data/vendor/libgit2/cmake/FindStatNsec.cmake +12 -18
  22. data/vendor/libgit2/cmake/Findfutimens.cmake +8 -8
  23. data/vendor/libgit2/cmake/FindmbedTLS.cmake +63 -70
  24. data/vendor/libgit2/cmake/IdeSplitSources.cmake +18 -18
  25. data/vendor/libgit2/cmake/PkgBuildConfig.cmake +60 -60
  26. data/vendor/libgit2/cmake/SanitizeBool.cmake +20 -20
  27. data/vendor/libgit2/cmake/SelectGSSAPI.cmake +37 -37
  28. data/vendor/libgit2/cmake/SelectHTTPParser.cmake +19 -0
  29. data/vendor/libgit2/cmake/SelectHTTPSBackend.cmake +100 -100
  30. data/vendor/libgit2/cmake/SelectHashes.cmake +39 -49
  31. data/vendor/libgit2/cmake/SelectRegex.cmake +51 -0
  32. data/vendor/libgit2/cmake/SelectSSH.cmake +41 -0
  33. data/vendor/libgit2/cmake/SelectWinHTTP.cmake +17 -0
  34. data/vendor/libgit2/cmake/SelectZlib.cmake +34 -0
  35. data/vendor/libgit2/deps/chromium-zlib/CMakeLists.txt +6 -6
  36. data/vendor/libgit2/deps/ntlmclient/CMakeLists.txt +31 -31
  37. data/vendor/libgit2/deps/ntlmclient/crypt_openssl.c +1 -1
  38. data/vendor/libgit2/deps/ntlmclient/ntlm.c +4 -4
  39. data/vendor/libgit2/deps/ntlmclient/ntlm.h +4 -4
  40. data/vendor/libgit2/deps/ntlmclient/ntlmclient.h +2 -2
  41. data/vendor/libgit2/deps/pcre/CMakeLists.txt +88 -88
  42. data/vendor/libgit2/deps/winhttp/CMakeLists.txt +14 -16
  43. data/vendor/libgit2/deps/zlib/adler32.c +0 -7
  44. data/vendor/libgit2/deps/zlib/crc32.c +288 -975
  45. data/vendor/libgit2/deps/zlib/crc32.h +436 -9441
  46. data/vendor/libgit2/deps/zlib/deflate.c +31 -83
  47. data/vendor/libgit2/deps/zlib/deflate.h +15 -12
  48. data/vendor/libgit2/deps/zlib/gzguts.h +2 -3
  49. data/vendor/libgit2/deps/zlib/infback.c +1 -2
  50. data/vendor/libgit2/deps/zlib/inffast.c +14 -14
  51. data/vendor/libgit2/deps/zlib/inflate.c +8 -39
  52. data/vendor/libgit2/deps/zlib/inflate.h +2 -3
  53. data/vendor/libgit2/deps/zlib/inftrees.c +3 -3
  54. data/vendor/libgit2/deps/zlib/trees.c +48 -27
  55. data/vendor/libgit2/deps/zlib/zlib.h +100 -126
  56. data/vendor/libgit2/deps/zlib/zutil.c +2 -2
  57. data/vendor/libgit2/deps/zlib/zutil.h +9 -12
  58. data/vendor/libgit2/include/git2/apply.h +16 -2
  59. data/vendor/libgit2/include/git2/attr.h +11 -2
  60. data/vendor/libgit2/include/git2/blame.h +4 -1
  61. data/vendor/libgit2/include/git2/blob.h +14 -1
  62. data/vendor/libgit2/include/git2/branch.h +2 -0
  63. data/vendor/libgit2/include/git2/buffer.h +18 -78
  64. data/vendor/libgit2/include/git2/cert.h +2 -2
  65. data/vendor/libgit2/include/git2/checkout.h +5 -2
  66. data/vendor/libgit2/include/git2/clone.h +3 -3
  67. data/vendor/libgit2/include/git2/commit.h +2 -0
  68. data/vendor/libgit2/include/git2/common.h +5 -12
  69. data/vendor/libgit2/include/git2/config.h +19 -3
  70. data/vendor/libgit2/include/git2/credential.h +2 -1
  71. data/vendor/libgit2/include/git2/credential_helpers.h +1 -0
  72. data/vendor/libgit2/include/git2/deprecated.h +1 -1
  73. data/vendor/libgit2/include/git2/describe.h +7 -2
  74. data/vendor/libgit2/include/git2/diff.h +17 -9
  75. data/vendor/libgit2/include/git2/email.h +1 -1
  76. data/vendor/libgit2/include/git2/errors.h +1 -2
  77. data/vendor/libgit2/include/git2/filter.h +7 -2
  78. data/vendor/libgit2/include/git2/graph.h +1 -0
  79. data/vendor/libgit2/include/git2/ignore.h +1 -1
  80. data/vendor/libgit2/include/git2/index.h +11 -5
  81. data/vendor/libgit2/include/git2/indexer.h +19 -0
  82. data/vendor/libgit2/include/git2/merge.h +23 -3
  83. data/vendor/libgit2/include/git2/message.h +2 -0
  84. data/vendor/libgit2/include/git2/object.h +23 -0
  85. data/vendor/libgit2/include/git2/odb.h +37 -7
  86. data/vendor/libgit2/include/git2/odb_backend.h +1 -1
  87. data/vendor/libgit2/include/git2/pack.h +24 -8
  88. data/vendor/libgit2/include/git2/patch.h +8 -0
  89. data/vendor/libgit2/include/git2/pathspec.h +1 -1
  90. data/vendor/libgit2/include/git2/proxy.h +1 -1
  91. data/vendor/libgit2/include/git2/rebase.h +9 -1
  92. data/vendor/libgit2/include/git2/refdb.h +3 -0
  93. data/vendor/libgit2/include/git2/reflog.h +1 -1
  94. data/vendor/libgit2/include/git2/refs.h +2 -2
  95. data/vendor/libgit2/include/git2/remote.h +184 -37
  96. data/vendor/libgit2/include/git2/repository.h +14 -9
  97. data/vendor/libgit2/include/git2/reset.h +2 -2
  98. data/vendor/libgit2/include/git2/revparse.h +1 -1
  99. data/vendor/libgit2/include/git2/revwalk.h +4 -1
  100. data/vendor/libgit2/include/git2/signature.h +1 -1
  101. data/vendor/libgit2/include/git2/stash.h +3 -3
  102. data/vendor/libgit2/include/git2/status.h +9 -3
  103. data/vendor/libgit2/include/git2/submodule.h +7 -2
  104. data/vendor/libgit2/include/git2/sys/commit_graph.h +1 -1
  105. data/vendor/libgit2/include/git2/sys/odb_backend.h +2 -5
  106. data/vendor/libgit2/include/git2/sys/remote.h +31 -0
  107. data/vendor/libgit2/include/git2/sys/stream.h +1 -1
  108. data/vendor/libgit2/include/git2/sys/transport.h +25 -34
  109. data/vendor/libgit2/include/git2/tag.h +1 -0
  110. data/vendor/libgit2/include/git2/tree.h +4 -3
  111. data/vendor/libgit2/include/git2/types.h +7 -7
  112. data/vendor/libgit2/include/git2/version.h +3 -3
  113. data/vendor/libgit2/include/git2/worktree.h +12 -2
  114. data/vendor/libgit2/src/CMakeLists.txt +189 -315
  115. data/vendor/libgit2/src/annotated_commit.h +1 -1
  116. data/vendor/libgit2/src/apply.c +18 -18
  117. data/vendor/libgit2/src/apply.h +2 -2
  118. data/vendor/libgit2/src/attr.c +18 -18
  119. data/vendor/libgit2/src/attr_file.c +17 -17
  120. data/vendor/libgit2/src/attr_file.h +4 -4
  121. data/vendor/libgit2/src/attrcache.c +17 -12
  122. data/vendor/libgit2/src/blame_git.c +1 -1
  123. data/vendor/libgit2/src/blob.c +33 -26
  124. data/vendor/libgit2/src/blob.h +1 -1
  125. data/vendor/libgit2/src/branch.c +150 -109
  126. data/vendor/libgit2/src/branch.h +15 -3
  127. data/vendor/libgit2/src/buf.c +126 -0
  128. data/vendor/libgit2/src/buf.h +50 -0
  129. data/vendor/libgit2/src/cc-compat.h +1 -1
  130. data/vendor/libgit2/src/checkout.c +74 -68
  131. data/vendor/libgit2/src/cherrypick.c +10 -10
  132. data/vendor/libgit2/src/clone.c +66 -66
  133. data/vendor/libgit2/src/commit.c +128 -58
  134. data/vendor/libgit2/src/commit.h +24 -1
  135. data/vendor/libgit2/src/commit_graph.c +68 -53
  136. data/vendor/libgit2/src/commit_graph.h +10 -3
  137. data/vendor/libgit2/src/commit_list.c +2 -3
  138. data/vendor/libgit2/src/common.h +10 -3
  139. data/vendor/libgit2/src/config.c +99 -77
  140. data/vendor/libgit2/src/config.h +15 -2
  141. data/vendor/libgit2/src/config_file.c +103 -91
  142. data/vendor/libgit2/src/config_mem.c +9 -9
  143. data/vendor/libgit2/src/config_parse.c +27 -23
  144. data/vendor/libgit2/src/crlf.c +24 -21
  145. data/vendor/libgit2/src/date.c +10 -17
  146. data/vendor/libgit2/src/date.h +33 -0
  147. data/vendor/libgit2/src/describe.c +27 -19
  148. data/vendor/libgit2/src/diff.c +25 -8
  149. data/vendor/libgit2/src/diff.h +2 -4
  150. data/vendor/libgit2/src/diff_driver.c +34 -36
  151. data/vendor/libgit2/src/diff_driver.h +3 -3
  152. data/vendor/libgit2/src/diff_file.c +29 -20
  153. data/vendor/libgit2/src/diff_generate.c +30 -6
  154. data/vendor/libgit2/src/diff_generate.h +5 -3
  155. data/vendor/libgit2/src/diff_print.c +102 -95
  156. data/vendor/libgit2/src/diff_stats.c +40 -29
  157. data/vendor/libgit2/src/{message.h → diff_stats.h} +7 -6
  158. data/vendor/libgit2/src/diff_tform.c +9 -8
  159. data/vendor/libgit2/src/diff_xdiff.c +3 -8
  160. data/vendor/libgit2/src/email.c +54 -38
  161. data/vendor/libgit2/src/email.h +1 -1
  162. data/vendor/libgit2/src/errors.c +18 -18
  163. data/vendor/libgit2/src/features.h.in +6 -1
  164. data/vendor/libgit2/src/fetch.c +69 -24
  165. data/vendor/libgit2/src/fetch.h +1 -1
  166. data/vendor/libgit2/src/fetchhead.c +19 -19
  167. data/vendor/libgit2/src/filebuf.c +28 -28
  168. data/vendor/libgit2/src/filebuf.h +1 -1
  169. data/vendor/libgit2/src/filter.c +96 -52
  170. data/vendor/libgit2/src/filter.h +26 -5
  171. data/vendor/libgit2/src/fs_path.c +1912 -0
  172. data/vendor/libgit2/src/fs_path.h +752 -0
  173. data/vendor/libgit2/src/futils.c +91 -85
  174. data/vendor/libgit2/src/futils.h +26 -14
  175. data/vendor/libgit2/src/hash/sha1/collisiondetect.c +2 -2
  176. data/vendor/libgit2/src/hash/sha1/common_crypto.c +2 -2
  177. data/vendor/libgit2/src/hash/sha1/generic.c +2 -2
  178. data/vendor/libgit2/src/hash/sha1/mbedtls.c +2 -2
  179. data/vendor/libgit2/src/hash/sha1/openssl.c +2 -2
  180. data/vendor/libgit2/src/hash/sha1/sha1dc/sha1.c +1 -1
  181. data/vendor/libgit2/src/hash/sha1/win32.c +6 -6
  182. data/vendor/libgit2/src/hash/sha1.h +3 -1
  183. data/vendor/libgit2/src/hash.c +67 -35
  184. data/vendor/libgit2/src/hash.h +12 -12
  185. data/vendor/libgit2/src/ident.c +18 -18
  186. data/vendor/libgit2/src/ignore.c +35 -34
  187. data/vendor/libgit2/src/ignore.h +2 -2
  188. data/vendor/libgit2/src/index.c +79 -80
  189. data/vendor/libgit2/src/index.h +6 -3
  190. data/vendor/libgit2/src/indexer.c +75 -57
  191. data/vendor/libgit2/src/iterator.c +64 -56
  192. data/vendor/libgit2/src/iterator.h +5 -5
  193. data/vendor/libgit2/src/khash.h +1 -1
  194. data/vendor/libgit2/src/libgit2.c +22 -19
  195. data/vendor/libgit2/src/mailmap.c +38 -36
  196. data/vendor/libgit2/src/merge.c +27 -27
  197. data/vendor/libgit2/src/merge.h +1 -14
  198. data/vendor/libgit2/src/merge_driver.c +2 -2
  199. data/vendor/libgit2/src/merge_file.c +13 -3
  200. data/vendor/libgit2/src/message.c +21 -10
  201. data/vendor/libgit2/src/midx.c +83 -66
  202. data/vendor/libgit2/src/midx.h +3 -3
  203. data/vendor/libgit2/src/mwindow.c +1 -1
  204. data/vendor/libgit2/src/net.c +278 -68
  205. data/vendor/libgit2/src/net.h +10 -3
  206. data/vendor/libgit2/src/netops.c +1 -1
  207. data/vendor/libgit2/src/netops.h +1 -1
  208. data/vendor/libgit2/src/notes.c +20 -29
  209. data/vendor/libgit2/src/object.c +49 -9
  210. data/vendor/libgit2/src/object.h +1 -1
  211. data/vendor/libgit2/src/odb.c +35 -32
  212. data/vendor/libgit2/src/odb.h +1 -1
  213. data/vendor/libgit2/src/odb_loose.c +68 -68
  214. data/vendor/libgit2/src/odb_mempack.c +18 -5
  215. data/vendor/libgit2/src/odb_pack.c +43 -43
  216. data/vendor/libgit2/src/oid.c +11 -4
  217. data/vendor/libgit2/src/oid.h +15 -0
  218. data/vendor/libgit2/src/pack-objects.c +41 -26
  219. data/vendor/libgit2/src/pack-objects.h +11 -6
  220. data/vendor/libgit2/src/pack.c +10 -10
  221. data/vendor/libgit2/src/patch.c +3 -3
  222. data/vendor/libgit2/src/patch.h +1 -0
  223. data/vendor/libgit2/src/patch_generate.c +27 -11
  224. data/vendor/libgit2/src/patch_generate.h +5 -5
  225. data/vendor/libgit2/src/patch_parse.c +24 -24
  226. data/vendor/libgit2/src/path.c +76 -1951
  227. data/vendor/libgit2/src/path.h +34 -741
  228. data/vendor/libgit2/src/pathspec.c +6 -6
  229. data/vendor/libgit2/src/pathspec.h +2 -2
  230. data/vendor/libgit2/src/posix.c +3 -3
  231. data/vendor/libgit2/src/posix.h +1 -0
  232. data/vendor/libgit2/src/pqueue.h +1 -1
  233. data/vendor/libgit2/src/proxy.c +4 -1
  234. data/vendor/libgit2/src/proxy.h +1 -1
  235. data/vendor/libgit2/src/push.c +30 -35
  236. data/vendor/libgit2/src/push.h +4 -16
  237. data/vendor/libgit2/src/rand.c +226 -0
  238. data/vendor/libgit2/src/rand.h +37 -0
  239. data/vendor/libgit2/src/reader.c +8 -8
  240. data/vendor/libgit2/src/reader.h +2 -2
  241. data/vendor/libgit2/src/rebase.c +89 -88
  242. data/vendor/libgit2/src/refdb_fs.c +447 -173
  243. data/vendor/libgit2/src/refs.c +32 -32
  244. data/vendor/libgit2/src/refs.h +2 -2
  245. data/vendor/libgit2/src/refspec.c +32 -37
  246. data/vendor/libgit2/src/refspec.h +5 -2
  247. data/vendor/libgit2/src/regexp.c +1 -1
  248. data/vendor/libgit2/src/remote.c +713 -419
  249. data/vendor/libgit2/src/remote.h +15 -10
  250. data/vendor/libgit2/src/repository.c +350 -467
  251. data/vendor/libgit2/src/repository.h +11 -10
  252. data/vendor/libgit2/src/reset.c +8 -5
  253. data/vendor/libgit2/src/revert.c +10 -10
  254. data/vendor/libgit2/src/revparse.c +48 -35
  255. data/vendor/libgit2/src/revwalk.c +7 -7
  256. data/vendor/libgit2/src/signature.c +12 -6
  257. data/vendor/libgit2/src/signature.h +1 -1
  258. data/vendor/libgit2/src/sortedcache.c +1 -1
  259. data/vendor/libgit2/src/sortedcache.h +1 -1
  260. data/vendor/libgit2/src/stash.c +36 -37
  261. data/vendor/libgit2/src/status.c +4 -1
  262. data/vendor/libgit2/src/{buffer.c → str.c} +157 -151
  263. data/vendor/libgit2/src/str.h +357 -0
  264. data/vendor/libgit2/src/streams/mbedtls.c +8 -6
  265. data/vendor/libgit2/src/streams/openssl_dynamic.h +3 -3
  266. data/vendor/libgit2/src/submodule.c +171 -159
  267. data/vendor/libgit2/src/submodule.h +1 -1
  268. data/vendor/libgit2/src/sysdir.c +68 -52
  269. data/vendor/libgit2/src/sysdir.h +15 -10
  270. data/vendor/libgit2/src/tag.c +29 -27
  271. data/vendor/libgit2/src/thread.h +3 -3
  272. data/vendor/libgit2/src/threadstate.c +3 -3
  273. data/vendor/libgit2/src/threadstate.h +1 -1
  274. data/vendor/libgit2/src/trace.c +1 -14
  275. data/vendor/libgit2/src/trace.h +5 -22
  276. data/vendor/libgit2/src/trailer.c +1 -1
  277. data/vendor/libgit2/src/transaction.c +1 -1
  278. data/vendor/libgit2/src/transport.c +10 -10
  279. data/vendor/libgit2/src/transports/auth.c +7 -9
  280. data/vendor/libgit2/src/transports/auth.h +2 -3
  281. data/vendor/libgit2/src/transports/auth_negotiate.c +12 -13
  282. data/vendor/libgit2/src/transports/auth_ntlm.c +10 -10
  283. data/vendor/libgit2/src/transports/auth_ntlm.h +0 -1
  284. data/vendor/libgit2/src/transports/git.c +9 -11
  285. data/vendor/libgit2/src/transports/http.c +37 -17
  286. data/vendor/libgit2/src/transports/http.h +2 -3
  287. data/vendor/libgit2/src/transports/httpclient.c +65 -65
  288. data/vendor/libgit2/src/transports/local.c +124 -116
  289. data/vendor/libgit2/src/transports/smart.c +51 -139
  290. data/vendor/libgit2/src/transports/smart.h +25 -31
  291. data/vendor/libgit2/src/transports/smart_pkt.c +33 -33
  292. data/vendor/libgit2/src/transports/smart_protocol.c +57 -39
  293. data/vendor/libgit2/src/transports/ssh.c +47 -112
  294. data/vendor/libgit2/src/transports/winhttp.c +50 -56
  295. data/vendor/libgit2/src/tree-cache.c +5 -5
  296. data/vendor/libgit2/src/tree-cache.h +2 -2
  297. data/vendor/libgit2/src/tree.c +59 -48
  298. data/vendor/libgit2/src/tree.h +1 -1
  299. data/vendor/libgit2/src/unix/map.c +0 -2
  300. data/vendor/libgit2/src/unix/posix.h +1 -4
  301. data/vendor/libgit2/src/unix/realpath.c +0 -2
  302. data/vendor/libgit2/src/util.c +14 -14
  303. data/vendor/libgit2/src/util.h +2 -28
  304. data/vendor/libgit2/src/vector.h +1 -1
  305. data/vendor/libgit2/src/win32/findfile.c +172 -116
  306. data/vendor/libgit2/src/win32/findfile.h +7 -4
  307. data/vendor/libgit2/src/win32/path_w32.c +140 -9
  308. data/vendor/libgit2/src/win32/path_w32.h +2 -0
  309. data/vendor/libgit2/src/win32/posix.h +0 -1
  310. data/vendor/libgit2/src/win32/posix_w32.c +11 -27
  311. data/vendor/libgit2/src/win32/w32_buffer.c +2 -3
  312. data/vendor/libgit2/src/win32/w32_buffer.h +2 -3
  313. data/vendor/libgit2/src/win32/w32_leakcheck.c +1 -1
  314. data/vendor/libgit2/src/worktree.c +116 -94
  315. data/vendor/libgit2/src/worktree.h +1 -1
  316. data/vendor/libgit2/src/xdiff/git-xdiff.h +53 -0
  317. data/vendor/libgit2/src/xdiff/xdiff.h +15 -15
  318. data/vendor/libgit2/src/xdiff/xdiffi.c +134 -108
  319. data/vendor/libgit2/src/xdiff/xemit.c +23 -7
  320. data/vendor/libgit2/src/xdiff/xhistogram.c +87 -78
  321. data/vendor/libgit2/src/xdiff/xinclude.h +1 -12
  322. data/vendor/libgit2/src/xdiff/xmerge.c +104 -117
  323. data/vendor/libgit2/src/xdiff/xpatience.c +6 -17
  324. data/vendor/libgit2/src/xdiff/xprepare.c +15 -20
  325. data/vendor/libgit2/src/xdiff/xutils.c +18 -7
  326. data/vendor/libgit2/src/zstream.c +5 -5
  327. data/vendor/libgit2/src/zstream.h +4 -4
  328. metadata +25 -10
  329. 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
- IF(DEBUG_STRICT_ALLOC)
10
- SET(GIT_DEBUG_STRICT_ALLOC 1)
11
- ENDIF()
12
- ADD_FEATURE_INFO(debugalloc GIT_DEBUG_STRICT_ALLOC "debug strict allocators")
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
- INCLUDE(PkgBuildConfig)
20
- INCLUDE(SanitizeBool)
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
- SET(LIBGIT2_PC_REQUIRES "")
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
- SET(LIBGIT2_PC_LIBS "")
36
+ set(LIBGIT2_PC_LIBS "")
30
37
 
31
- SET(LIBGIT2_INCLUDES
38
+ set(LIBGIT2_INCLUDES
32
39
  "${CMAKE_CURRENT_BINARY_DIR}"
33
- "${libgit2_SOURCE_DIR}/src"
34
- "${libgit2_SOURCE_DIR}/include")
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
- IF (HAVE_FUTIMENS)
47
- SET(GIT_USE_FUTIMENS 1)
48
- ENDIF ()
49
- ADD_FEATURE_INFO(futimens GIT_USE_FUTIMENS "futimens support")
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
- CHECK_PROTOTYPE_DEFINITION(qsort_r
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" HAVE_QSORT_R_BSD)
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
- CHECK_PROTOTYPE_DEFINITION(qsort_r
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" HAVE_QSORT_R_GNU)
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
- CHECK_FUNCTION_EXISTS(qsort_s HAVE_QSORT_S)
66
- IF (HAVE_QSORT_S)
67
- target_compile_definitions(git2internal PRIVATE HAVE_QSORT_S)
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
- IF(WIN32)
73
- LIST(APPEND LIBGIT2_LIBS ws2_32)
74
- ELSEIF(CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)")
75
- LIST(APPEND LIBGIT2_LIBS socket nsl)
76
- LIST(APPEND LIBGIT2_PC_LIBS "-lsocket" "-lnsl")
77
- ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Haiku")
78
- LIST(APPEND LIBGIT2_LIBS network)
79
- LIST(APPEND LIBGIT2_PC_LIBS "-lnetwork")
80
- ENDIF()
81
-
82
- CHECK_LIBRARY_EXISTS(rt clock_gettime "time.h" NEED_LIBRT)
83
- IF(NEED_LIBRT)
84
- LIST(APPEND LIBGIT2_LIBS rt)
85
- LIST(APPEND LIBGIT2_PC_LIBS "-lrt")
86
- ENDIF()
87
-
88
- IF(THREADSAFE)
89
- LIST(APPEND LIBGIT2_LIBS ${CMAKE_THREAD_LIBS_INIT})
90
- LIST(APPEND LIBGIT2_PC_LIBS ${CMAKE_THREAD_LIBS_INIT})
91
- ENDIF()
92
- ADD_FEATURE_INFO(threadsafe THREADSAFE "threadsafe support")
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
- IF (USE_NTLMCLIENT)
260
- SET(GIT_NTLM 1)
261
- ADD_SUBDIRECTORY("${libgit2_SOURCE_DIR}/deps/ntlmclient" "${libgit2_BINARY_DIR}/deps/ntlmclient")
262
- LIST(APPEND LIBGIT2_INCLUDES "${libgit2_SOURCE_DIR}/deps/ntlmclient")
263
- LIST(APPEND LIBGIT2_OBJECTS "$<TARGET_OBJECTS:ntlmclient>")
264
- ENDIF()
265
- ADD_FEATURE_INFO(ntlmclient GIT_NTLM "NTLM authentication support for Unix")
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
- INCLUDE(SelectGSSAPI)
131
+ include(SelectGSSAPI)
270
132
 
271
133
  # Optional external dependency: iconv
272
- IF (USE_ICONV)
273
- FIND_PACKAGE(Iconv)
274
- ENDIF()
275
- IF (ICONV_FOUND)
276
- SET(GIT_USE_ICONV 1)
277
- LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${ICONV_INCLUDE_DIR})
278
- LIST(APPEND LIBGIT2_LIBS ${ICONV_LIBRARIES})
279
- LIST(APPEND LIBGIT2_PC_LIBS ${ICONV_LIBRARIES})
280
- ENDIF()
281
- ADD_FEATURE_INFO(iconv GIT_USE_ICONV "iconv encoding conversion support")
282
-
283
-
284
- IF (THREADSAFE)
285
- IF (NOT WIN32)
286
- FIND_PACKAGE(Threads REQUIRED)
287
- ENDIF()
288
-
289
- SET(GIT_THREADS 1)
290
- ENDIF()
291
-
292
- IF (USE_NSEC)
293
- SET(GIT_USE_NSEC 1)
294
- ENDIF()
295
-
296
- IF (HAVE_STRUCT_STAT_ST_MTIM)
297
- SET(GIT_USE_STAT_MTIM 1)
298
- ELSEIF (HAVE_STRUCT_STAT_ST_MTIMESPEC)
299
- SET(GIT_USE_STAT_MTIMESPEC 1)
300
- ELSEIF (HAVE_STRUCT_STAT_ST_MTIME_NSEC)
301
- SET(GIT_USE_STAT_MTIME_NSEC 1)
302
- ENDIF()
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
- "${libgit2_SOURCE_DIR}/include/git2.h"
309
- "${libgit2_SOURCE_DIR}/include/git2/*.h"
310
- "${libgit2_SOURCE_DIR}/include/git2/sys/*.h")
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
- SET(WIN_RC "win32/git2.rc")
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
- IF (USE_LEAK_CHECKER STREQUAL "valgrind")
191
+ if(USE_LEAK_CHECKER STREQUAL "valgrind")
330
192
  target_compile_definitions(git2internal PRIVATE VALGRIND)
331
- ENDIF()
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
- IF(APPLE)
203
+ if(APPLE)
342
204
  # The old Secure Transport API has been deprecated in macOS 10.15.
343
- SET_SOURCE_FILES_PROPERTIES(streams/stransport.c PROPERTIES COMPILE_FLAGS -Wno-deprecated)
344
- ENDIF()
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
- IF(MSVC)
349
- SET_SOURCE_FILES_PROPERTIES(xdiff/xdiffi.c PROPERTIES COMPILE_FLAGS -WX-)
350
- SET_SOURCE_FILES_PROPERTIES(xdiff/xutils.c PROPERTIES COMPILE_FLAGS -WX-)
351
- ENDIF()
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
- IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
355
- SET(GIT_ARCH_64 1)
356
- ELSEIF (CMAKE_SIZEOF_VOID_P EQUAL 4)
357
- SET(GIT_ARCH_32 1)
358
- ELSEIF (CMAKE_SIZEOF_VOID_P)
359
- MESSAGE(FATAL_ERROR "Unsupported architecture (pointer size is ${CMAKE_SIZEOF_VOID_P} bytes)")
360
- ELSE()
361
- MESSAGE(FATAL_ERROR "Unsupported architecture (CMAKE_SIZEOF_VOID_P is unset)")
362
- ENDIF()
363
-
364
- CONFIGURE_FILE(features.h.in git2/sys/features.h)
365
-
366
- IDE_SPLIT_SOURCES(git2internal)
367
- LIST(APPEND LIBGIT2_OBJECTS $<TARGET_OBJECTS:git2internal>)
368
-
369
- TARGET_INCLUDE_DIRECTORIES(git2internal PRIVATE ${LIBGIT2_INCLUDES} PUBLIC ${libgit2_SOURCE_DIR}/include)
370
- TARGET_INCLUDE_DIRECTORIES(git2internal SYSTEM PRIVATE ${LIBGIT2_SYSTEM_INCLUDES})
371
-
372
- SET(LIBGIT2_OBJECTS ${LIBGIT2_OBJECTS} PARENT_SCOPE)
373
- SET(LIBGIT2_INCLUDES ${LIBGIT2_INCLUDES} PARENT_SCOPE)
374
- SET(LIBGIT2_SYSTEM_INCLUDES ${LIBGIT2_SYSTEM_INCLUDES} PARENT_SCOPE)
375
- SET(LIBGIT2_LIBS ${LIBGIT2_LIBS} PARENT_SCOPE)
376
-
377
- IF(XCODE_VERSION)
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
- FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/dummy.c "")
381
- LIST(APPEND LIBGIT2_OBJECTS ${CMAKE_CURRENT_BINARY_DIR}/dummy.c)
382
- ENDIF()
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
- ADD_LIBRARY(git2 ${WIN_RC} ${LIBGIT2_OBJECTS})
386
- TARGET_LINK_LIBRARIES(git2 ${LIBGIT2_LIBS})
259
+ add_library(git2 ${WIN_RC} ${LIBGIT2_OBJECTS})
260
+ target_link_libraries(git2 ${LIBGIT2_SYSTEM_LIBS})
387
261
 
388
- SET_TARGET_PROPERTIES(git2 PROPERTIES C_STANDARD 90)
389
- SET_TARGET_PROPERTIES(git2 PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${libgit2_BINARY_DIR})
390
- SET_TARGET_PROPERTIES(git2 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${libgit2_BINARY_DIR})
391
- SET_TARGET_PROPERTIES(git2 PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${libgit2_BINARY_DIR})
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
- IF(MSVC AND GIT_ARCH_64 AND NOT BUILD_SHARED_LIBS)
396
- SET_TARGET_PROPERTIES(git2 PROPERTIES STATIC_LIBRARY_FLAGS "/MACHINE:x64")
397
- ENDIF()
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
- IDE_SPLIT_SOURCES(git2)
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
- PKG_BUILD_CONFIG(NAME libgit2
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
- IF (MSVC_IDE)
421
- # Precompiled headers
422
- SET_TARGET_PROPERTIES(git2 PROPERTIES COMPILE_FLAGS "/Yuprecompiled.h /FIprecompiled.h")
423
- SET_SOURCE_FILES_PROPERTIES(win32/precompiled.c COMPILE_FLAGS "/Ycprecompiled.h")
424
- ENDIF ()
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
- INSTALL(TARGETS git2
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
- INSTALL(DIRECTORY ${libgit2_SOURCE_DIR}/include/git2 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
433
- INSTALL(FILES ${libgit2_SOURCE_DIR}/include/git2.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
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})
@@ -15,7 +15,7 @@
15
15
 
16
16
  typedef enum {
17
17
  GIT_ANNOTATED_COMMIT_REAL = 1,
18
- GIT_ANNOTATED_COMMIT_VIRTUAL = 2,
18
+ GIT_ANNOTATED_COMMIT_VIRTUAL = 2
19
19
  } git_annotated_commit_t;
20
20
 
21
21
  /**