1. 23 Oct, 2017 2 commits
  2. 20 Oct, 2017 2 commits
    • Merge pull request #4382 from pks-t/pks/cmake-source-dir · 8f05d2d8
      cmake: use project-relative binary and source directories
      Edward Thomson committed
    • cmake: use project-relative binary and source directories · 4da74c83
      Due to our split of CMake files into multiple modules, we had to replace
      some uses of the `${CMAKE_CURRENT_SOURCE_DIR}` and
      `${CMAKE_CURRENT_BINARY_DIR}` variables and replace them with
      `${CMAKE_SOURCE_DIR}` and `${CMAKE_BINARY_DIR}`. This enabled us to
      still be able to refer to top-level files when defining build
      instructions inside of a subdirectory.
      
      When replacing all variables, it was assumed that the absolute set of
      variables is always relative to the current project. But in fact, this
      is not the case, as these variables always point to the source and
      binary directory as given by the top-levl project. So the change
      actually broke the ability to include libgit2 directly as a subproject,
      as source files cannot be found anymore.
      
      Fix this by instead using project-specific source and binary directories
      with `${libgit2_SOURCE_DIR}` and `${libgit2_BINARY_DIR}`.
      Patrick Steinhardt committed
  3. 19 Oct, 2017 1 commit
  4. 14 Oct, 2017 1 commit
  5. 09 Oct, 2017 9 commits
  6. 07 Oct, 2017 7 commits
  7. 06 Oct, 2017 9 commits
  8. 04 Oct, 2017 1 commit
  9. 28 Sep, 2017 2 commits
  10. 27 Sep, 2017 3 commits
  11. 22 Sep, 2017 1 commit
    • cmake: use static dependencies when building static libgit2 · 49551254
      CMake allows us to build a static library by simply setting the variable
      `BUILD_SHARED_LIBS` to `OFF`. While this causes us to create a static
      libgit2.a archive, it will not automatically cause CMake to only locate
      static archives when searching for dependencies. This does no harm in
      case of building our libgit2.a, as we do not want to include all
      required dependencies in the resulting archive anyway. Instead, we ask
      users of a static libgit2.a to link against the required set of static
      archives themselves, typically aided by the libgit2.pc file.
      
      Where it does cause harm, though, is when we build the libgit2_clar test
      suite. CMake has happily populated our LIBGIT2_LIBS variable with shared
      libraries, and so linking the final libgit2_clar test does not do the
      right thing. It will simply ignore those shared libraries, we end up
      with a test suite with undefined symbols.
      
      To fix the issue, we can instruct CMake to only locate libraries with a
      certain suffix. As static libraries are typically identifiable by their
      ".a" suffix on Unix-based systems, we can instruct CMake to only locate
      libraries with this suffix to restrict it from finding any shared
      libraries. This fixes building a static libgit2_clar test suite.
      
      Note that this ignores the problem on Windows. The problem here is that
      we cannot even distinguish static and dynamic libraries by only
      inspecting their suffix. So we just ignore the problem on Windows, for
      now.
      Patrick Steinhardt committed
  12. 20 Sep, 2017 2 commits
    • cmake: fix static linking for bundled deps · 8c19969a
      Our bundled deps are being built as simple static libraries which are
      then linked into the libgit2 library via `TARGET_LINK_LIBRARIES`. While
      this works for a dynamically built libgit2 library, using this function
      to link two static libraries does not have the expected outcome of
      merging those static libraries into one big library. This leads to
      symbols of our bundled deps being undefined in the resulting libgit2
      archive.
      
      As we have bumped our minimum CMake version to 2.8.11, we can now easily
      make use of object libraries for our bundled dependencies. So build
      instructions are still self-contained inside of the dependency
      directories and the resulting object libraries can just be added to the
      LIBGIT2_OBJECTS list, which will cause them to be linked into the final
      resulting static library. This fixes the issue of undefined symbols.
      Patrick Steinhardt committed
    • cmake: unify version check for target include directories · d8d2f21e
      There are two locations where we check whether CMake supports
      `TARGET_INCLUDE_DIRECTORIES`. While the first one uses `VERSION_LESS
      2.8.12`, the second one uses `VERSION_GREATER 2.8.11`, which are
      obviously equivalent to each other. It'd still be easier to grep for
      specific CMake versions being required for some features if both used
      the same conditional mentioning the actual target version required. So
      this commit refactors these conditions to make them equal.
      Patrick Steinhardt committed