Skip to content

Commit a36e024

Browse files
committed
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
2 parents bc86ef1 + 9709163 commit a36e024

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

contrib/buildsystems/CMakeLists.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,10 +1001,14 @@ parse_makefile_for_sources(unit-test_SOURCES ${CMAKE_SOURCE_DIR}/Makefile "UNIT_
10011001
list(TRANSFORM unit-test_SOURCES REPLACE "\\$\\(UNIT_TEST_DIR\\)/" "${CMAKE_SOURCE_DIR}/t/unit-tests/")
10021002
add_library(unit-test-lib STATIC ${unit-test_SOURCES})
10031003

1004+
parse_makefile_for_sources(clar-test_SOURCES ${CMAKE_SOURCE_DIR}/Makefile "CLAR_TEST_OBJS")
1005+
list(TRANSFORM clar-test_SOURCES REPLACE "\\$\\(UNIT_TEST_DIR\\)/" "${CMAKE_SOURCE_DIR}/t/unit-tests/")
1006+
add_library(clar-test-lib STATIC ${clar-test_SOURCES})
1007+
10041008
parse_makefile_for_scripts(unit_test_PROGRAMS "UNIT_TEST_PROGRAMS" "")
10051009
foreach(unit_test ${unit_test_PROGRAMS})
10061010
add_executable("${unit_test}" "${CMAKE_SOURCE_DIR}/t/unit-tests/${unit_test}.c")
1007-
target_link_libraries("${unit_test}" unit-test-lib common-main)
1011+
target_link_libraries("${unit_test}" unit-test-lib clar-test-lib common-main)
10081012
set_target_properties("${unit_test}"
10091013
PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/t/unit-tests/bin)
10101014
if(MSVC)
@@ -1046,13 +1050,13 @@ add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/t/unit-tests/clar.suite"
10461050
VERBATIM)
10471051

10481052
add_library(unit-tests-lib ${clar_test_SUITES}
1049-
"${CMAKE_SOURCE_DIR}/t/unit-tests/clar/clar.c"
10501053
"${CMAKE_BINARY_DIR}/t/unit-tests/clar-decls.h"
10511054
"${CMAKE_BINARY_DIR}/t/unit-tests/clar.suite"
10521055
)
1056+
target_include_directories(clar-test-lib PUBLIC "${CMAKE_BINARY_DIR}/t/unit-tests")
10531057
target_include_directories(unit-tests-lib PUBLIC "${CMAKE_BINARY_DIR}/t/unit-tests")
1054-
add_executable(unit-tests "${CMAKE_SOURCE_DIR}/t/unit-tests/unit-test.c")
1055-
target_link_libraries(unit-tests unit-tests-lib common-main)
1058+
add_executable(unit-tests)
1059+
target_link_libraries(unit-tests unit-tests-lib clar-test-lib common-main)
10561060
set_target_properties(unit-tests
10571061
PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/t/unit-tests/bin)
10581062
if(MSVC)

ident.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static struct passwd *xgetpwuid_self(int *is_bogus)
5959

6060
static void copy_gecos(const struct passwd *w, struct strbuf *name)
6161
{
62-
char *src;
62+
const char *src;
6363

6464
/* Traditionally GECOS field had office phone numbers etc, separated
6565
* with commas. Also & stands for capitalized form of the login name.

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,11 +1109,11 @@ elif host_machine.system() == 'windows'
11091109
libgit_sources += [
11101110
'compat/mingw.c',
11111111
'compat/winansi.c',
1112+
'compat/win32/dirent.c',
11121113
'compat/win32/flush.c',
11131114
'compat/win32/path-utils.c',
11141115
'compat/win32/pthread.c',
11151116
'compat/win32/syslog.c',
1116-
'compat/win32/dirent.c',
11171117
'compat/win32mmap.c',
11181118
'compat/nedmalloc/nedmalloc.c',
11191119
]

0 commit comments

Comments
 (0)