{"thread":{"id":"64498","subject":"[PATCH] cmake: stop trying to build the reftable and xdiff libraries","startedAt":"2025-11-17T20:40:14Z","lastAt":"2025-11-17T20:40:14Z","messageCount":1,"participants":["Johannes Schindelin via GitGitGadget"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"530837","messageId":"pull.2006.git.1763412008722.gitgitgadget@gmail.com","threadId":"64498","inReplyTo":null,"subject":"[PATCH] cmake: stop trying to build the reftable and xdiff libraries","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2025-11-17T20:40:08Z","receivedAt":"2025-11-17T20:40:14Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nIn the `en/make-libgit-a` topic branch, more precisely in the commits\nf3b4c89d59f1 (make: delete REFTABLE_LIB, add reftable to LIB_OBJS,\n2025-10-02) and cf680cdb9543 (make: delete XDIFF_LIB, add xdiff to\nLIB_OBJS, 2025-10-02), the strategy to build three static libraries was\nrethought, and instead only one static library is now built.\n\nThis is good.\n\nHowever, the CMake definition was not changed accordingly, and now\nCMake-based builds fail thusly:\n\n  [...]\n  Generating hook-list.h\n  CMake Error at CMakeLists.txt:122 (string):\n    string sub-command REPLACE requires at least four arguments.\n  Call Stack (most recent call first):\n    CMakeLists.txt:711 (parse_makefile_for_sources)\n\n  CMake Error at CMakeLists.txt:122 (string):\n    string sub-command REPLACE requires at least four arguments.\n  Call Stack (most recent call first):\n    CMakeLists.txt:717 (parse_makefile_for_sources)\n\n  -- Configuring incomplete, errors occurred!\n\nFix that by removing the parts that expect the reftable and xdiff\nobjects to be defined separately in the Makefile, still.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n    cmake: stop trying to build the reftable and xdiff libraries\n    \n    This was needed to be able to pass the CI builds of Git for Windows\n    v2.52. With all the Windows build problems observed in the win+Meson job\n    in seen lately, it might become unsustainable to also keep taking care\n    of the CMake definition. But then, the same might be said about the\n    Windows part of the Meson build definition.\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-2006%2Fdscho%2Fadjust-cmake-to-xdiff-and-reftable-merge-into-libgit-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2006/dscho/adjust-cmake-to-xdiff-and-reftable-merge-into-libgit-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/2006\n\n contrib/buildsystems/CMakeLists.txt | 14 +-------------\n 1 file changed, 1 insertion(+), 13 deletions(-)\n\ndiff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt\nindex edb0fc04ad..479163ab5c 100644\n--- a/contrib/buildsystems/CMakeLists.txt\n+++ b/contrib/buildsystems/CMakeLists.txt\n@@ -679,18 +679,6 @@ list(APPEND libgit_SOURCES \"${CMAKE_BINARY_DIR}/version-def.h\")\n \n add_library(libgit ${libgit_SOURCES} ${compat_SOURCES})\n \n-#libxdiff\n-parse_makefile_for_sources(libxdiff_SOURCES ${CMAKE_SOURCE_DIR}/Makefile \"XDIFF_OBJS\")\n-\n-list(TRANSFORM libxdiff_SOURCES PREPEND \"${CMAKE_SOURCE_DIR}/\")\n-add_library(xdiff STATIC ${libxdiff_SOURCES})\n-\n-#reftable\n-parse_makefile_for_sources(reftable_SOURCES ${CMAKE_SOURCE_DIR}/Makefile \"REFTABLE_OBJS\")\n-\n-list(TRANSFORM reftable_SOURCES PREPEND \"${CMAKE_SOURCE_DIR}/\")\n-add_library(reftable STATIC ${reftable_SOURCES})\n-\n if(WIN32)\n \tadd_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/git.rc\n \t\t\tCOMMAND \"${SH_EXE}\" \"${CMAKE_SOURCE_DIR}/GIT-VERSION-GEN\"\n@@ -720,7 +708,7 @@ endif()\n #link all required libraries to common-main\n add_library(common-main OBJECT ${CMAKE_SOURCE_DIR}/common-main.c)\n \n-target_link_libraries(common-main libgit xdiff reftable ${ZLIB_LIBRARIES})\n+target_link_libraries(common-main libgit ${ZLIB_LIBRARIES})\n if(Intl_FOUND)\n \ttarget_link_libraries(common-main ${Intl_LIBRARIES})\n endif()\n\nbase-commit: 9a2fb147f2c61d0cab52c883e7e26f5b7948e3ed\n-- \ngitgitgadget\n"}]}