Skip to content

Commit

Permalink
cmake: install headless-git.
Browse files Browse the repository at this point in the history
headless-git is a git executable without opening a console window. It is
useful when other GUI executables want to call git. We should install it
together with git on Windows.

Signed-off-by: Yuyi Wang <Strawberry_Str@hotmail.com>
  • Loading branch information
Berrysoft authored and dscho committed Sep 24, 2024
1 parent 179e8ac commit 00848d0
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 @@ -740,6 +740,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 @@ -919,7 +920,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 00848d0

Please sign in to comment.