Skip to content

pr-614/SibiSiddharthan/git-og-v5

This is an attempt to build Git using CMake. CMake is cross-platform build
generator which works well on a variety of platforms(primarily Linux and
Windows). Using CMake we can check whether certain headers exist, certain
functions exist, the required libraries are present and configure the build
accordingly. Using CMake we can also build and test Git out of source,
resulting in a clean source tree.

Tested platforms

Ubuntu 18.04 GCC 7.4 Clang 8.0.1

Windows MinGW GCC 9.2 Clang 9 Visual Studio 2015,2017,2019

Changes:

1) The CMake script has been relocated to contrib/buildsystems 2) The CMake
script parses the Makefile for the sources. LIB_OBJS BUILTIN_OBJS XDIFF_OBJS
VCSSVN_OBJS TEST_BUILTINS_OBJS SCRIPT_SH SCRIPT_PERL 3) Philip suggested to
change the error message if sh/bash was not found on windows. 4) CMake now
tests for ICONV_OMITS_BOM, NO_ST_BLOCKS_IN_STRUCT_STAT 5) Renamed the
variable test_helper_sources to test-tool_SOURCES [PATCH 4/8] to be
consistent with the naming of source variables.

Changes v2: Changes 1,2,4 have been rebased to PATCH 01/xx CMake uses
GIT-VERSION-GEN to get the version of Git Fixed a bug where a Windows user
can pose as Linux user and vice versa. [PATCH 6/8]

Changes v3: Patch changes are moved from the commit messages and are placed
here. Code inside check_c_source_(compiles/runs) have been formatted
according to git coding guidelines. [PATCH 1/8] The CMake script parses the
Makefile for SCRIPT_LIB also. [PATCH 2/8] The CMake script globs templates,
po files. Logic has been added to place the template files in their
respective directories instead of hard-coding them. [PATCH 2/8]

Changes v4: Removed EXE_EXTENSION conditional stuff using
CMAKE_EXECUTABLE_SUFFIX [PATCH 4/8] There was an issue in build pipelines
where CMake was not able to find the correct iconv library (caused by an
update that installed PostgreSQL), so we need to manually set the location
of the iconv library and its includes. This issue is extremely rare and is
specific to the implementation of FindIconv.cmake. Other libraries are
unaffected. [PATCH 8/8]

Sibi Siddharthan (8):
  Introduce CMake support for configuring Git
  cmake: generate the shell/perl/python scripts and templates,
    translations
  cmake: installation support for git
  cmake: support for testing git with ctest
  cmake: support for testing git when building out of the source tree
  cmake: support for building git on windows with mingw
  cmake: support for building git on windows with msvc and clang.
  ci: modification of main.yml to use cmake for vs-build job

 .github/workflows/main.yml          |   39 +-
 contrib/buildsystems/CMakeLists.txt | 1000 +++++++++++++++++++++++++++
 2 files changed, 1024 insertions(+), 15 deletions(-)
 create mode 100644 contrib/buildsystems/CMakeLists.txt

base-commit: e8ba1cc988e122f1a74cda161ba3ec1bf22fe88f

Submitted-As: https://lore.kernel.org/git/pull.614.v5.git.1593187898.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.614.git.1587700897.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.614.v2.git.1589302254.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.614.v3.git.1590759624.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.614.v4.git.1591986566.gitgitgadget@gmail.com
Assets 2
Loading