1. 04 Apr, 2022 1 commit
  2. 23 Mar, 2022 6 commits
  3. 23 Feb, 2022 2 commits
  4. 13 Feb, 2022 1 commit
    • cmake: Fix package name for system http-parser · 8bc9eda7
      Fix building against system http-parser library by fixing
      the find_package() argument.  It seems to have been accidentally changed
      from HTTPParser to HTTP_Parser in de178d36, effectively making
      the build against system library fail to find it:
      
      ```
      CMake Warning at cmake/SelectHTTPParser.cmake:3 (find_package):
        By not providing "FindHTTP_Parser.cmake" in CMAKE_MODULE_PATH this project
        has asked CMake to find a package configuration file provided by
        "HTTP_Parser", but CMake did not find one.
      
        Could not find a package configuration file provided by "HTTP_Parser" with
        any of the following names:
      
          HTTP_ParserConfig.cmake
          http_parser-config.cmake
      
        Add the installation prefix of "HTTP_Parser" to CMAKE_PREFIX_PATH or set
        "HTTP_Parser_DIR" to a directory containing one of the above files.  If
        "HTTP_Parser" provides a separate development package or SDK, be sure it
        has been installed.
      Call Stack (most recent call first):
        src/CMakeLists.txt:97 (include)
      
      CMake Error at cmake/SelectHTTPParser.cmake:11 (message):
        http-parser support was requested but not found
      Call Stack (most recent call first):
        src/CMakeLists.txt:97 (include)
      ```
      Michał Górny committed
  5. 09 Jan, 2022 1 commit
  6. 05 Jan, 2022 1 commit
  7. 29 Dec, 2021 1 commit
    • Disabling setting `CMAKE_FIND_LIBRARY_SUFFIXES` on Apple platforms. · 3eb39819
      On macOS, since Big Sur, the libraries were moved to a cache. The SDK comes
      with stubs in the SDK (`/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/lib/`
      or whatever SDK version one has installed) where most have the `.tbd` suffix
      (although some still are `.a`). Forcing `CMAKE_FIND_LIBRARY_SUFFIXES` on Apple
      platforms broke building, unless one has copies of the libraries installed
      elsewhere (like Brew), as many libraries (like `iconv` or `pcre`) are not
      found.
      
      This fix disables setting the `CMAKE_FIND_LIBRARY_SUFFIXES` to `.a` if
      the platform is `APPLE` when building static libs.
      Miguel Arroz committed
  8. 23 Dec, 2021 1 commit
    • cmake: use PROJECT_SOURCE_DIR of CMAKE_SOURCE_DIR · c5cd71b2
      Also applies to *_BINARY_DIR.
      
      This effectively reverts 84083dcc,
      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.
      Josh Junon committed
  9. 22 Nov, 2021 1 commit
  10. 17 Nov, 2021 1 commit
  11. 14 Nov, 2021 3 commits
  12. 11 Nov, 2021 10 commits
  13. 28 Oct, 2021 1 commit
  14. 14 Sep, 2021 1 commit
  15. 28 Aug, 2021 2 commits
  16. 24 Aug, 2021 1 commit
    • openssl: dynamically load libssl and symbols (optionally) · 0903cac1
      Provide an interface around OpenSSL to dynamically load the libraries
      and symbols, so that users can distribute a libgit2 library that is not
      linked directly against OpenSSL.  This enables users to target multiple
      distributions with a single binary.
      
      This mechanism is optional and disabled by default.  Configure cmake
      with -DUSE_HTTPS=OpenSSL-Dynamic to use it.
      Edward Thomson committed
  17. 30 Jul, 2021 1 commit
  18. 12 Jul, 2020 1 commit
    • cmake: remove CheckPrototypeDefinition module · 9bc6e655
      In the past, we've imported the CheckPrototypeDefinition into our own
      module directory as it wasn't yet available in all supported CMake
      versions. Now that we require at least CMake v3.5, we don't need to
      bundle it anymore as it's included with the distribution already.
      
      Let's drop the included modules and always use upstream's version.
      Patrick Steinhardt committed
  19. 01 Jun, 2020 1 commit
  20. 15 May, 2020 1 commit
    • cmake: Sort source files for reproducible builds · b85eefb4
      We currently use `FILE(GLOB ...)` in most places to find source and
      header files. This is problematic in that the order of files returned
      depends on the operating system's directory iteration order and may thus
      not be deterministic. As a result, we link object files in unspecified
      order, which may cause the linker to emit different code across runs.
      
      Fix this issue by sorting all code used as input to the libgit2 library
      to improve the reliability of reproducible builds.
      Patrick Steinhardt committed
  21. 01 Apr, 2020 1 commit
  22. 14 Mar, 2020 1 commit
    • cmake: use install directories provided via GNUInstallDirs · 87fc539f
      We currently hand-code logic to configure where to install our artifacts
      via the `LIB_INSTALL_DIR`, `INCLUDE_INSTALL_DIR` and `BIN_INSTALL_DIR`
      variables. This is reinventing the wheel, as CMake already provide a way
      to do that via `CMAKE_INSTALL_<DIR>` paths, e.g. `CMAKE_INSTALL_LIB`.
      This requires users of libgit2 to know about the discrepancy and will
      require special hacks for any build systems that handle these variables
      in an automated way. One such example is Gentoo Linux, which sets up
      these paths in both the cmake and cmake-utils eclass.
      
      So let's stop doing that: the GNUInstallDirs module handles it in a
      better way for us, especially so as the actual values are dependent on
      CMAKE_INSTALL_PREFIX. This commit removes our own set of variables and
      instead refers users to use the standard ones.
      
      As a second benefit, this commit also fixes our pkgconfig generation to
      use the GNUInstallDirs module. We had a bug there where we ignored the
      CMAKE_INSTALL_PREFIX when configuring the libdir and includedir keys, so
      if libdir was set to "lib64", then libdir would be an invalid path. With
      GNUInstallDirs, we can now use `CMAKE_INSTALL_FULL_LIBDIR`, which
      handles the prefix for us.
      Patrick Steinhardt committed