aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-03-06 14:06:31 -0800
committerJunio C Hamano <gitster@pobox.com>2025-03-06 14:06:32 -0800
commita36e024e989f4d35f35987a60e3af8022cac3420 (patch)
tree10df6edd9c0c5de101a69fdf14e2e329ffb31c3b
parentbc86ef104acd8e7c0ee7eb25de981ed5a3255615 (diff)
parent970916368764347c38d36c727b2e6e0086e784e3 (diff)
downloadgit-a36e024e989f4d35f35987a60e3af8022cac3420.tar.gz
Merge branch 'js/win-2.49-build-fixes'
Hotfix to help building Git-for-Windows. * js/win-2.49-build-fixes: cmake: generalize the handling of the `CLAR_TEST_OBJS` list meson: fix sorting ident: stop assuming that `gw_gecos` is writable
-rw-r--r--contrib/buildsystems/CMakeLists.txt12
-rw-r--r--ident.c2
-rw-r--r--meson.build2
3 files changed, 10 insertions, 6 deletions
diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt
index c6fbd57e15..25b495fa73 100644
--- a/contrib/buildsystems/CMakeLists.txt
+++ b/contrib/buildsystems/CMakeLists.txt
@@ -1001,10 +1001,14 @@ parse_makefile_for_sources(unit-test_SOURCES ${CMAKE_SOURCE_DIR}/Makefile "UNIT_
list(TRANSFORM unit-test_SOURCES REPLACE "\\$\\(UNIT_TEST_DIR\\)/" "${CMAKE_SOURCE_DIR}/t/unit-tests/")
add_library(unit-test-lib STATIC ${unit-test_SOURCES})
+parse_makefile_for_sources(clar-test_SOURCES ${CMAKE_SOURCE_DIR}/Makefile "CLAR_TEST_OBJS")
+list(TRANSFORM clar-test_SOURCES REPLACE "\\$\\(UNIT_TEST_DIR\\)/" "${CMAKE_SOURCE_DIR}/t/unit-tests/")
+add_library(clar-test-lib STATIC ${clar-test_SOURCES})
+
parse_makefile_for_scripts(unit_test_PROGRAMS "UNIT_TEST_PROGRAMS" "")
foreach(unit_test ${unit_test_PROGRAMS})
add_executable("${unit_test}" "${CMAKE_SOURCE_DIR}/t/unit-tests/${unit_test}.c")
- target_link_libraries("${unit_test}" unit-test-lib common-main)
+ target_link_libraries("${unit_test}" unit-test-lib clar-test-lib common-main)
set_target_properties("${unit_test}"
PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/t/unit-tests/bin)
if(MSVC)
@@ -1046,13 +1050,13 @@ add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/t/unit-tests/clar.suite"
VERBATIM)
add_library(unit-tests-lib ${clar_test_SUITES}
- "${CMAKE_SOURCE_DIR}/t/unit-tests/clar/clar.c"
"${CMAKE_BINARY_DIR}/t/unit-tests/clar-decls.h"
"${CMAKE_BINARY_DIR}/t/unit-tests/clar.suite"
)
+target_include_directories(clar-test-lib PUBLIC "${CMAKE_BINARY_DIR}/t/unit-tests")
target_include_directories(unit-tests-lib PUBLIC "${CMAKE_BINARY_DIR}/t/unit-tests")
-add_executable(unit-tests "${CMAKE_SOURCE_DIR}/t/unit-tests/unit-test.c")
-target_link_libraries(unit-tests unit-tests-lib common-main)
+add_executable(unit-tests)
+target_link_libraries(unit-tests unit-tests-lib clar-test-lib common-main)
set_target_properties(unit-tests
PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/t/unit-tests/bin)
if(MSVC)
diff --git a/ident.c b/ident.c
index caf41fb2a9..967895d885 100644
--- a/ident.c
+++ b/ident.c
@@ -59,7 +59,7 @@ static struct passwd *xgetpwuid_self(int *is_bogus)
static void copy_gecos(const struct passwd *w, struct strbuf *name)
{
- char *src;
+ const char *src;
/* Traditionally GECOS field had office phone numbers etc, separated
* with commas. Also & stands for capitalized form of the login name.
diff --git a/meson.build b/meson.build
index e86085b0a4..efe2871c9d 100644
--- a/meson.build
+++ b/meson.build
@@ -1109,11 +1109,11 @@ elif host_machine.system() == 'windows'
libgit_sources += [
'compat/mingw.c',
'compat/winansi.c',
+ 'compat/win32/dirent.c',
'compat/win32/flush.c',
'compat/win32/path-utils.c',
'compat/win32/pthread.c',
'compat/win32/syslog.c',
- 'compat/win32/dirent.c',
'compat/win32mmap.c',
'compat/nedmalloc/nedmalloc.c',
]