summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
Commit message (Collapse)AuthorAgeFilesLines
* cmake: refactor `check_prototype_definition`Edward Thomson2023-05-121-1/+1
| | | | | Introduce `check_prototype_definition_safe` that is safe for `Werror` usage.
* Merge pull request #6482 from libgit2/ethomson/xdiffEdward Thomson2023-04-131-0/+1
|\ | | | | xdiff: move xdiff to 'deps'
| * xdiff: move xdiff to 'deps'Edward Thomson2023-03-031-0/+1
| | | | | | | | | | | | | | xdiff is a dependency (from git core) and more properly belongs in the 'deps' directory. Move it there, and add a stub for cmake to resolve xdiff from the system location in the future. (At present, bundled xdiff remains hardcoded.)
* | meta: the main branch is now v1.7.0Edward Thomson2023-04-121-1/+1
| |
* | Merge pull request #6533 from libgit2/ethomson/schannel-2Edward Thomson2023-03-271-6/+0
|\ \ | | | | | | Introduce Schannel and SSPI for Windows
| * | http: introduce schannel streams for windowsEdward Thomson2023-03-211-6/+0
| |/ | | | | | | | | | | | | | | | | | | Provide a stream interface for Schannel - the native crypto APIs - on Windows. This allows Windows to use the same HTTP transport that all the other platforms use, with its own native crypto. Ultimately this allows us to deprecate WinHTTP and we need not add support for our socket changes in two places (our HTTP stack and the WinHTTP stack).
* | v1.6.3: update version numbersEdward Thomson2023-03-211-1/+1
|/
* v1.6.2: update version numbersEdward Thomson2023-02-281-1/+1
|
* v1.6.1: correct missing version number updatesv1.6.1Edward Thomson2023-02-251-1/+1
|
* v1.6: update version numbersEdward Thomson2023-02-241-1/+1
|
* sha256: make sha256 an experimental optional featureEdward Thomson2022-06-201-0/+4
| | | | | | | | | | libgit2 can be built with optional, experimental sha256 support. This allows consumers to begin testing and providing feedback for our sha256 support while we continue to develop it, and allows us to make API breaking changes while we iterate on a final sha256 implementation. The results will be `git2-experimental.dll` and installed as `git2-experimental.h` to avoid confusion with a production libgit2.
* sha: support CommonCrypto for SHA256Edward Thomson2022-03-231-1/+1
|
* sha: add sha256 algorithmEdward Thomson2022-03-231-0/+1
| | | | | Add support for a SHA256 hash algorithm, and add the "builtin" SHA256 hash engine (from RFC 6234).
* sha1: remove generic implementationEdward Thomson2022-03-231-1/+1
| | | | | | Remove the "generic" implementation; it should never be used; it only existed for a no-dependencies configuration, and our bundled sha1dc satisfies that requirement _and_ is correct.
* cmake: export libraries needed to compile against libgit2Edward Thomson2022-02-271-0/+8
| | | | | If users are using us as a direct dependency (via `add_subdirectory`) then they may want to know the libraries to link to; tell them.
* cli: infrastructure for a cli projectEdward Thomson2022-02-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a command-line interface for libgit2. The goal is for it to be git-compatible. 1. The libgit2 developers can more easily dogfood libgit2 to find bugs, and performance issues. 2. There is growing usage of libgit2's examples as a client; libgit2's examples should be exactly that - simple code samples that illustrate libgit2's usage. This satisfies that need directly. 3. By producing a client ourselves, we can better understand the needs of client creators, possibly producing a shared "middleware" for commonly-used pieces of client functionality like interacting with external tools. 4. Since git is the reference implementation, we may be able to benefit from git's unit tests, running their test suite against our CLI to ensure correct behavior. This commit introduces a simple infrastructure for the CLI. The CLI is currently links libgit2 statically; this is because the utility layer is required for libgit2 _but_ shares the error state handling with libgit2 itself. There's no obviously good solution here without introducing annoying indirection or more complexity. Until we can untangle that dependency, this is a good step forward. In the meantime, we link the libgit2 object files, but we do not include the (private) libgit2 headers. This constrains the CLI to the public libgit2 interfaces.
* cmake: document CMakeLists.txt hierarchyEdward Thomson2022-02-221-1/+4
|
* meta: update version number to v1.5.0-alphaEdward Thomson2022-02-141-1/+1
| | | | | | | | | | Update the version number in main to v1.5.0-alpha. This helps people understand that the main builds are not part of the v1.4.0 release train. We use "alpha" to indicate builds out of main (or nightlies) as semver v2 requires the prerelease component is compared lexicographically. Thus, our "beta" and "rc" releases should follow.
* v1.4: update version numbersEdward Thomson2022-02-131-1/+1
|
* cmake: use PROJECT_SOURCE_DIR of CMAKE_SOURCE_DIRJosh Junon2021-12-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Also applies to *_BINARY_DIR. This effectively reverts 84083dcc8bd41332ccac9d7b537f3e254d79011c, which broke all users of libgit2 that use it as a CMake subdirectory (via `add_subdirectory()`). This is because CMAKE_SOURCE_DIR refers to the root-most CMake directory, which in the case of `add_subdirectory()` is a parent project to libgit2 and thus the paths don't make any sense to the configuration files. Corollary, CMAKE_SOURCE_DIR only makes sense if the CMake project is always the root project - which can rarely be guaranteed. In all honesty, CMake should deprecate and eventually remove CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR. It's been the source of headaches and confusion for years, they're rarely useful over CMAKE_CURRENT_(SOURCE|BINARY)_DIR or PROJECT_(SOURCE|BINARY)_DIR, and they cause a lot of confusing configuration and source code layouts to boot. Any time they are used, they break `add_subdirectory()` almost 100% of the time, cause confusing error messages, and hide subtle bugs.
* cmake: use CMAKE_SOURCE_DIR and CMAKE_BINARY_DIRethomson/cleanupEdward Thomson2021-11-221-1/+1
| | | | | | Instead of using the project-specific `libgit2_SOURCE_DIR` and `libgit2_BINARY_DIR` variables, use `CMAKE_SOURCE_DIR` and `CMAKE_BINARY_DIR`.
* cmake: enable testing at the top levelEdward Thomson2021-11-171-0/+1
| | | | | | | Ensure that we `enable_testing()` at the top-level CMakeLists.txt or else we'll need to navigate within the build directory to the correct place in the hierarchy to run `ctest`. Now we can `ctest` at the top-level again.
* cmake: use a string not a boolean for LIBGIT2_FILENAMEEdward Thomson2021-11-141-1/+1
|
* cmake: move test enablement into test cmakeEdward Thomson2021-11-111-1/+0
|
* cmake: reorganize fileEdward Thomson2021-11-111-13/+5
|
* cmake: move fuzzer args to the fuzzer's cmakeEdward Thomson2021-11-111-15/+2
|
* cmake: move deprecation definition to src/Edward Thomson2021-11-111-4/+0
| | | | | There's no need to add the deprecation at the top-level. Our tests add deprecation explicitly.
* cmake: move cflag defaults into a separate moduleEdward Thomson2021-11-111-171/+18
|
* cmake: USE_SSH is not on by defaultEdward Thomson2021-11-111-1/+1
|
* cmake: standardize USE_WINHTTPEdward Thomson2021-11-111-2/+2
| | | | | WinHTTP can now be disabled with `USE_WINHTTP=OFF` instead of `WINHTTP=OFF` to better support the other cmake semantics.
* cmake: standardize USE_THREADS and USE_NSECEdward Thomson2021-11-111-11/+14
| | | | | | | | Threading can now be disabled with `USE_THREADS=OFF` instead of `THREADSAFE=OFF` to better support the other cmake semantics. Nanosecond support is the default _if_ we can detect it. This should be our default always - like threads - and people can opt out explicitly.
* cmake: stylistic refactoringEdward Thomson2021-10-181-192/+203
| | | | | Ensure that we always use lowercase function names, and that we do not have spaces preceding open parentheses, for consistency.
* cmake: remove unused STDCALL optionEdward Thomson2021-10-181-4/+0
| | | | | The `STDCALL` option was removed; remove the (unreachable) error message.
* trace: always enabledEdward Thomson2021-10-181-1/+0
| | | | There's no need to make tracing opt-in; it should always be included.
* cmake: allow USE_ICONV on any UnixEdward Thomson2021-10-181-2/+0
|
* cmake: allow ENABLE_REPRODUCIBLE_BUILDS on macOSEdward Thomson2021-10-181-2/+0
| | | | | macOS may support ENABLE_REPRODUCIBLE_BUILDS, allow users to opt-in to it. (Especially since ENABLE_REPRODUCIBLE_BUILDS is not the default.)
* cmake: BUILD_CLAR is now BUILD_TESTSethomson/clar_no_moreEdward Thomson2021-10-171-3/+3
| | | | | Nobody knows what CLAR is. The test building option should be `BUILD_TESTS`.
* v1.3: update version numberethomson/v1_3Edward Thomson2021-09-221-1/+1
|
* v1.2: update version informationEdward Thomson2021-08-311-1/+1
|
* Merge pull request #6006 from boretrk/c11-warningsEdward Thomson2021-08-251-0/+1
|\ | | | | GCC C11 warnings
| * enable gcc warnings for C11 specific extensionsPeter Pettersson2021-08-251-0/+1
| |
* | Merge pull request #5950 from boretrk/posixtestEdward Thomson2021-08-251-0/+1
|\ \ | |/ |/| open: input validation for empty segments in path
| * tests: optional test for p_open() with empty path segmentsPeter Pettersson2021-08-081-0/+1
| |
* | enable warnings for C11 specific extensionsPeter Pettersson2021-08-251-0/+1
|/
* cmake: extended futimens checking on macOSethomson/futimensEdward Thomson2021-07-301-0/+1
|
* alloc: add GIT_DEBUG_STRICT_ALLOCEdward Thomson2021-07-191-0/+1
| | | | | | | | | | | Add `GIT_DEBUG_STRICT_ALLOC` to help identify problematic callers of allocation code that pass a `0` size to the allocators and then expect a non-`NULL` return. When given a 0-size allocation, `malloc` _may_ return either a `NULL` _or_ a pointer that is not writeable. Most systems return a non-`NULL` pointer; AIX is an outlier. We should be able to cope with this AIXy behavior, so this adds an option to emulate it.
* Use an option instead of a flag for USE_BUNDLED_ZLIBlhchavez2021-01-041-2/+1
| | | | | Now `USE_BUNDLED_ZLIB` can be set to the string `Chromium` to enable the Chromium implementation of zlib.
* zlib: Add support for building with Chromium's zlib implementationlhchavez2020-12-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change builds libgit2 using Chromium's zlib implementation by invoking cmake with `-DUSE_BUNDLED_ZLIB=ON -DUSE_CHROMIUM_ZLIB=ON`, which is ~10% faster than the bundled zlib for the core::zstream suite. This version of zlib has some optimizations: a) Decompression (Intel+ARM): inflate_fast, adler32, crc32, etc. b) Compression (Intel): fill_window, longest_match, hash function, etc. Due to the introduction of SIMD optimizations, and to get the maximum performance out of this fork of zlib, this requires an x86_64 processor with SSE4.2 and CLMUL (anything Westmere or later, ~2010). The Chromium zlib implementation also supports ARM with NEON, but it has not been enabled in this patch. Performance =========== TL;DR: Running just `./libgit2_clar -score::zstream` 100 times in a loop took 0:56.30 before and 0:50.67 after (~10% reduction!). The bundled and system zlib implementations on an Ubuntu Focal system perform relatively similar (the bundled one is marginally better due to the compiler being able to inline some functions), so only the bundled and Chromium zlibs were compared. For a more balanced comparison (to ensure that nothing regressed overall), `libgit2_clar` under `perf` was also run, and the zlib-related functions were compared. Bundled ------- ```shell cmake \ -DUSE_BUNDLED_ZLIB=ON \ -DUSE_CHROMIUM_ZLIB=OFF \ -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ -DCMAKE_C_FLAGS="-fPIC -fno-omit-frame-pointer" \ -GNinja \ .. ninja perf record --call-graph=dwarf ./libgit2_clar perf report --children ``` ``` Samples: 87K of event 'cycles', Event count (approx.): 75923450603 Children Self Command Shared Objec Symbol + 4.14% 0.01% libgit2_clar libgit2_clar [.] git_zstream_get_output_chunk + 2.91% 0.00% libgit2_clar libgit2_clar [.] git_zstream_get_output + 0.69% 0.00% libgit2_clar libgit2_clar [.] git_zstream_get_output (inlined) 0.17% 0.00% libgit2_clar libgit2_clar [.] git_zstream_init 0.02% 0.00% libgit2_clar libgit2_clar [.] git_zstream_reset 0.00% 0.00% libgit2_clar libgit2_clar [.] git_zstream_eos 0.00% 0.00% libgit2_clar libgit2_clar [.] git_zstream_done 0.00% 0.00% libgit2_clar libgit2_clar [.] git_zstream_free (inlined) Samples: 87K of event 'cycles', Event count (approx.): 75923450603 Children Self Command Shared Objec Symbol + 3.12% 0.01% libgit2_clar libgit2_clar [.] deflate + 2.65% 1.48% libgit2_clar libgit2_clar [.] deflate_slow + 1.60% 0.55% libgit2_clar libgit2_clar [.] inflate + 0.53% 0.00% libgit2_clar libgit2_clar [.] write_deflate 0.49% 0.36% libgit2_clar libgit2_clar [.] inflate_fast 0.46% 0.02% libgit2_clar libgit2_clar [.] deflate_fast 0.19% 0.19% libgit2_clar libgit2_clar [.] inflate_table 0.16% 0.01% libgit2_clar libgit2_clar [.] inflateInit_ 0.15% 0.00% libgit2_clar libgit2_clar [.] inflateInit2_ (inlined) 0.10% 0.00% libgit2_clar libgit2_clar [.] deflateInit_ 0.10% 0.00% libgit2_clar libgit2_clar [.] deflateInit2_ 0.03% 0.00% libgit2_clar libgit2_clar [.] deflateReset (inlined) 0.02% 0.00% libgit2_clar libgit2_clar [.] deflateReset 0.02% 0.00% libgit2_clar libgit2_clar [.] inflateEnd 0.02% 0.00% libgit2_clar libgit2_clar [.] deflateEnd 0.01% 0.00% libgit2_clar libgit2_clar [.] deflateResetKeep 0.01% 0.01% libgit2_clar libgit2_clar [.] inflateReset2 0.01% 0.00% libgit2_clar libgit2_clar [.] deflateReset (inlined) 0.00% 0.00% libgit2_clar libgit2_clar [.] inflateStateCheck (inlined) 0.00% 0.00% libgit2_clar libgit2_clar [.] inflateReset (inlined) 0.00% 0.00% libgit2_clar libgit2_clar [.] inflateStateCheck (inlined) 0.00% 0.00% libgit2_clar libgit2_clar [.] deflateStateCheck (inlined) 0.00% 0.00% libgit2_clar libgit2_clar [.] inflateResetKeep (inlined) ``` Chromium -------- ```shell cmake \ -DUSE_BUNDLED_ZLIB=ON \ -DUSE_CHROMIUM_ZLIB=ON \ -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ -DCMAKE_C_FLAGS="-fPIC -fno-omit-frame-pointer" \ -GNinja \ .. ninja perf record --call-graph=dwarf ./libgit2_clar perf report --children ``` ``` Samples: 97K of event 'cycles', Event count (approx.): 80862210917 Children Self Command Shared Objec Symbol + 3.31% 0.00% libgit2_clar libgit2_clar [.] git_zstream_get_output_chunk + 2.27% 0.01% libgit2_clar libgit2_clar [.] git_zstream_get_output + 0.55% 0.00% libgit2_clar libgit2_clar [.] git_zstream_get_output (inlined) 0.18% 0.00% libgit2_clar libgit2_clar [.] git_zstream_init 0.02% 0.00% libgit2_clar libgit2_clar [.] git_zstream_reset 0.00% 0.00% libgit2_clar libgit2_clar [.] git_zstream_free (inlined) 0.00% 0.00% libgit2_clar libgit2_clar [.] git_zstream_done 0.00% 0.00% libgit2_clar libgit2_clar [.] git_zstream_free Samples: 97K of event 'cycles', Event count (approx.): 80862210917 Children Self Command Shared Objec Symbol + 2.55% 0.01% libgit2_clar libgit2_clar [.] deflate + 2.25% 1.41% libgit2_clar libgit2_clar [.] deflate_slow + 1.10% 0.52% libgit2_clar libgit2_clar [.] inflate 0.36% 0.00% libgit2_clar libgit2_clar [.] write_deflate 0.30% 0.03% libgit2_clar libgit2_clar [.] deflate_fast 0.28% 0.15% libgit2_clar libgit2_clar [.] inflate_fast_chunk_ 0.19% 0.19% libgit2_clar libgit2_clar [.] inflate_table 0.17% 0.01% libgit2_clar libgit2_clar [.] inflateInit_ 0.16% 0.00% libgit2_clar libgit2_clar [.] inflateInit2_ (inlined) 0.15% 0.00% libgit2_clar libgit2_clar [.] deflateInit_ 0.15% 0.00% libgit2_clar libgit2_clar [.] deflateInit2_ 0.11% 0.01% libgit2_clar libgit2_clar [.] adler32_z 0.09% 0.09% libgit2_clar libgit2_clar [.] adler32_simd_ 0.05% 0.00% libgit2_clar libgit2_clar [.] deflateReset (inlined) 0.05% 0.00% libgit2_clar libgit2_clar [.] deflate_read_buf 0.03% 0.00% libgit2_clar libgit2_clar [.] inflateEnd 0.02% 0.00% libgit2_clar libgit2_clar [.] deflateReset 0.01% 0.00% libgit2_clar libgit2_clar [.] deflateEnd 0.01% 0.01% libgit2_clar libgit2_clar [.] inflateReset2 0.01% 0.00% libgit2_clar libgit2_clar [.] inflateReset (inlined) 0.00% 0.00% libgit2_clar libgit2_clar [.] adler32 0.00% 0.00% libgit2_clar libgit2_clar [.] inflateResetKeep (inlined) 0.00% 0.00% libgit2_clar libgit2_clar [.] deflateResetKeep 0.00% 0.00% libgit2_clar libgit2_clar [.] inflateStateCheck (inlined) 0.00% 0.00% libgit2_clar libgit2_clar [.] inflateStateCheck (inlined) 0.00% 0.00% libgit2_clar libgit2_clar [.] inflateStateCheck (inlined) 0.00% 0.00% libgit2_clar libgit2_clar [.] deflateStateCheck (inlined) ```
* cmake: rename MSVC_CRTDBG to WIN32_LEAKCHECKEdward Thomson2020-11-211-4/+4
|
* Release v1.1ethomson/v1.1Edward Thomson2020-10-121-1/+1
|