]> git.ipfire.org Git - thirdparty/git.git/commitdiff
cmake: support SKIP_DASHED_BUILT_INS
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Sat, 27 Mar 2021 23:06:22 +0000 (23:06 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sun, 28 Mar 2021 01:02:23 +0000 (18:02 -0700)
Just like the Makefile-based build learned to skip hard-linking the
dashed built-ins in 179227d6e21 (Optionally skip linking/copying the
built-ins, 2020-09-21), this patch teaches the CMake-based build the
same trick.

Note: In contrast to the Makefile-based process, the built-ins would
only be linked during installation, not already when Git is built.
Therefore, the CMake-based build that we use in our CI builds _already_
does not link those built-ins (because the files are not installed
anywhere, they are used to run the test suite in-place).

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

index ac3dbc079af8319ca6bb2344e874fef4f518b219..4683547489f48688070d4f03256e5f15b6af0664 100644 (file)
@@ -685,13 +685,17 @@ endif()
 
 parse_makefile_for_executables(git_builtin_extra "BUILT_INS")
 
+option(SKIP_DASHED_BUILT_INS "Skip hardlinking the dashed versions of the built-ins")
+
 #Creating hardlinks
+if(NOT SKIP_DASHED_BUILT_INS)
 foreach(s ${git_SOURCES} ${git_builtin_extra})
        string(REPLACE "${CMAKE_SOURCE_DIR}/builtin/" "" s ${s})
        string(REPLACE ".c" "" s ${s})
        file(APPEND ${CMAKE_BINARY_DIR}/CreateLinks.cmake "file(CREATE_LINK git${EXE_EXTENSION} git-${s}${EXE_EXTENSION})\n")
        list(APPEND git_links ${CMAKE_BINARY_DIR}/git-${s}${EXE_EXTENSION})
 endforeach()
+endif()
 
 if(CURL_FOUND)
        set(remote_exes