]> git.ipfire.org Git - thirdparty/git.git/commitdiff
cmake: stop trying to build the reftable and xdiff libraries
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Mon, 17 Nov 2025 20:40:08 +0000 (20:40 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 17 Nov 2025 22:18:28 +0000 (14:18 -0800)
In the `en/make-libgit-a` topic branch, more precisely in the commits
f3b4c89d59f1 (make: delete REFTABLE_LIB, add reftable to LIB_OBJS,
2025-10-02) and cf680cdb9543 (make: delete XDIFF_LIB, add xdiff to
LIB_OBJS, 2025-10-02), the strategy to build three static libraries was
rethought, and instead only one static library is now built.

This is good.

However, the CMake definition was not changed accordingly, and now
CMake-based builds fail thusly:

  [...]
  Generating hook-list.h
  CMake Error at CMakeLists.txt:122 (string):
    string sub-command REPLACE requires at least four arguments.
  Call Stack (most recent call first):
    CMakeLists.txt:711 (parse_makefile_for_sources)

  CMake Error at CMakeLists.txt:122 (string):
    string sub-command REPLACE requires at least four arguments.
  Call Stack (most recent call first):
    CMakeLists.txt:717 (parse_makefile_for_sources)

  -- Configuring incomplete, errors occurred!

Fix that by removing the parts that expect the reftable and xdiff
objects to be defined separately in the Makefile, still.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/buildsystems/CMakeLists.txt

index edb0fc04ad76494d8f2ab76f8b5359e54742c90c..479163ab5cd3b5bfc17eef16091d8ce4e0582d8b 100644 (file)
@@ -679,18 +679,6 @@ list(APPEND libgit_SOURCES "${CMAKE_BINARY_DIR}/version-def.h")
 
 add_library(libgit ${libgit_SOURCES} ${compat_SOURCES})
 
-#libxdiff
-parse_makefile_for_sources(libxdiff_SOURCES ${CMAKE_SOURCE_DIR}/Makefile "XDIFF_OBJS")
-
-list(TRANSFORM libxdiff_SOURCES PREPEND "${CMAKE_SOURCE_DIR}/")
-add_library(xdiff STATIC ${libxdiff_SOURCES})
-
-#reftable
-parse_makefile_for_sources(reftable_SOURCES ${CMAKE_SOURCE_DIR}/Makefile "REFTABLE_OBJS")
-
-list(TRANSFORM reftable_SOURCES PREPEND "${CMAKE_SOURCE_DIR}/")
-add_library(reftable STATIC ${reftable_SOURCES})
-
 if(WIN32)
        add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/git.rc
                        COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/GIT-VERSION-GEN"
@@ -720,7 +708,7 @@ endif()
 #link all required libraries to common-main
 add_library(common-main OBJECT ${CMAKE_SOURCE_DIR}/common-main.c)
 
-target_link_libraries(common-main libgit xdiff reftable ${ZLIB_LIBRARIES})
+target_link_libraries(common-main libgit ${ZLIB_LIBRARIES})
 if(Intl_FOUND)
        target_link_libraries(common-main ${Intl_LIBRARIES})
 endif()