Skip to content

Commit

Permalink
cmake: install headless-git. (#4338)
Browse files Browse the repository at this point in the history
Even if CMake is not the canonical way to build Git for Windows, but
CMake support merely exists in Git to support building Git for Windows
using Visual Studio, we should include `headless-git` in such a scenario
when installing the binaries to a given location.
  • Loading branch information
dscho authored and Git for Windows Build Agent committed Jan 2, 2025
2 parents ca5f351 + 7d591fb commit 1da4583
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion contrib/buildsystems/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,7 @@ if(WIN32)
endif()

add_executable(headless-git ${CMAKE_SOURCE_DIR}/compat/win32/headless.c)
list(APPEND PROGRAMS_BUILT headless-git)
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
target_link_options(headless-git PUBLIC -municode -Wl,-subsystem,windows)
elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
Expand Down Expand Up @@ -945,7 +946,7 @@ list(TRANSFORM git_perl_scripts PREPEND "${CMAKE_BINARY_DIR}/")

#install
foreach(program ${PROGRAMS_BUILT})
if(program MATCHES "^(git|git-shell|scalar)$")
if(program MATCHES "^(git|git-shell|headless-git|scalar)$")
install(TARGETS ${program}
RUNTIME DESTINATION bin)
else()
Expand Down

0 comments on commit 1da4583

Please sign in to comment.