diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-08-15 17:19:47 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-08-15 17:19:47 (GMT) |
commit | 32f4fa8d3be86a00188aa4c4af1cd375e25e4558 (patch) | |
tree | 6b046c0fa7b7453aecf28c41adff8bb44a0b71e8 /contrib/buildsystems | |
parent | fc6bba66bc1de0296b7e452499b0ccd8e4c65b18 (diff) | |
parent | 0050f8e401a70b1eda9e7358b04e6d6ef3d64ab1 (diff) | |
download | git-32f4fa8d3be86a00188aa4c4af1cd375e25e4558.zip git-32f4fa8d3be86a00188aa4c4af1cd375e25e4558.tar.gz git-32f4fa8d3be86a00188aa4c4af1cd375e25e4558.tar.bz2 |
Merge branch 'ds/maintenance-on-windows-fix'
Windows updates.
* ds/maintenance-on-windows-fix:
git maintenance: avoid console window in scheduled tasks on Windows
win32: add a helper to run `git.exe` without a foreground window
Diffstat (limited to 'contrib/buildsystems')
-rw-r--r-- | contrib/buildsystems/CMakeLists.txt | 9 | ||||
-rw-r--r-- | contrib/buildsystems/Generators/Vcxproj.pm | 4 | ||||
-rwxr-xr-x | contrib/buildsystems/engine.pl | 1 |
3 files changed, 12 insertions, 2 deletions
diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index 4faa419..6b819e2 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -738,6 +738,15 @@ if(WIN32) else() message(FATAL_ERROR "Unhandled compiler: ${CMAKE_C_COMPILER_ID}") endif() + + add_executable(headless-git ${CMAKE_SOURCE_DIR}/compat/win32/headless.c) + 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") + target_link_options(headless-git PUBLIC /NOLOGO /ENTRY:wWinMainCRTStartup /SUBSYSTEM:WINDOWS) + else() + message(FATAL_ERROR "Unhandled compiler: ${CMAKE_C_COMPILER_ID}") + endif() elseif(UNIX) target_link_libraries(common-main pthread rt) endif() diff --git a/contrib/buildsystems/Generators/Vcxproj.pm b/contrib/buildsystems/Generators/Vcxproj.pm index 1a25789..b2e68a1 100644 --- a/contrib/buildsystems/Generators/Vcxproj.pm +++ b/contrib/buildsystems/Generators/Vcxproj.pm @@ -76,7 +76,7 @@ sub createProject { my $libs_release = "\n "; my $libs_debug = "\n "; - if (!$static_library) { + if (!$static_library && $name ne 'headless-git') { $libs_release = join(";", sort(grep /^(?!libgit\.lib|xdiff\/lib\.lib|vcs-svn\/lib\.lib|reftable\/libreftable\.lib)/, @{$$build_structure{"$prefix${name}_LIBS"}})); $libs_debug = $libs_release; $libs_debug =~ s/zlib\.lib/zlibd\.lib/g; @@ -230,7 +230,7 @@ EOM print F << "EOM"; </ItemGroup> EOM - if (!$static_library || $target =~ 'vcs-svn' || $target =~ 'xdiff') { + if ((!$static_library || $target =~ 'vcs-svn' || $target =~ 'xdiff') && !($name =~ /headless-git/)) { my $uuid_libgit = $$build_structure{"LIBS_libgit_GUID"}; my $uuid_libreftable = $$build_structure{"LIBS_reftable/libreftable_GUID"}; my $uuid_xdiff_lib = $$build_structure{"LIBS_xdiff/lib_GUID"}; diff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl index ed6c459..069be7e 100755 --- a/contrib/buildsystems/engine.pl +++ b/contrib/buildsystems/engine.pl @@ -371,6 +371,7 @@ sub handleLinkLine # exit(1); foreach (@objfiles) { my $sourcefile = $_; + $sourcefile =~ s/^headless-git\.o$/compat\/win32\/headless.c/; $sourcefile =~ s/\.o$/.c/; push(@sources, $sourcefile); push(@cflags, @{$compile_options{"${sourcefile}_CFLAGS"}}); |