]> git.ipfire.org Git - thirdparty/git.git/commitdiff
cmake: use writev(3p) wrapper as needed
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 3 Apr 2026 08:55:02 +0000 (08:55 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 3 Apr 2026 17:34:01 +0000 (10:34 -0700)
This is a companion patch of 3b9b2c2a29a (compat/posix: introduce
writev(3p) wrapper, 2026-03-13) where support for using the `writev()`
wrapper was introduced in the `Makefile` and the Meson-based build, but
the CMake build still needs that treatment, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/buildsystems/CMakeLists.txt

index 28877feb9d17074736cffad5f9e82d32f3a256c1..ad58c320be14f85e5f139db4e262015da6459baf 100644 (file)
@@ -374,7 +374,7 @@ endif()
 #function checks
 set(function_checks
        strcasestr memmem strlcpy strtoimax strtoumax strtoull
-       setenv mkdtemp poll pread memmem)
+       setenv mkdtemp poll pread memmem writev)
 
 #unsetenv,hstrerror are incompatible with windows build
 if(NOT WIN32)
@@ -419,6 +419,10 @@ if(NOT HAVE_MEMMEM)
        list(APPEND compat_SOURCES compat/memmem.c)
 endif()
 
+if(NOT HAVE_WRITEV)
+       list(APPEND compat_SOURCES compat/writev.c)
+endif()
+
 if(NOT WIN32)
        if(NOT HAVE_UNSETENV)
                list(APPEND compat_SOURCES compat/unsetenv.c)