cmake: support SKIP_DASHED_BUILT_INS

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>

Johannes Schindelin committed Mar 27, 2021 at 23:06 UTC 7bb544a4d13810c10d2c0fa1bfed336c7a31a4bc
1 file changed +4
contrib/buildsystems/CMakeLists.txt
+4
@@ -685,13 +685,17 @@ endif()
685
686 parse_makefile_for_executables(git_builtin_extra "BUILT_INS")
687
688 +option(SKIP_DASHED_BUILT_INS "Skip hardlinking the dashed versions of the built-ins")
689 +
690 #Creating hardlinks
691 +if(NOT SKIP_DASHED_BUILT_INS)
692 foreach(s ${git_SOURCES} ${git_builtin_extra})
693 string(REPLACE "${CMAKE_SOURCE_DIR}/builtin/" "" s ${s})
694 string(REPLACE ".c" "" s ${s})
695 file(APPEND ${CMAKE_BINARY_DIR}/CreateLinks.cmake "file(CREATE_LINK git${EXE_EXTENSION} git-${s}${EXE_EXTENSION})\n")
696 list(APPEND git_links ${CMAKE_BINARY_DIR}/git-${s}${EXE_EXTENSION})
697 endforeach()
698 +endif()
699
700 if(CURL_FOUND)
701 set(remote_exes