cmake: use writev(3p) wrapper as needed
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>
Johannes Schindelin committed
Apr 3, 2026 at 08:55 UTC
89152af176ea94ea8f3249115b6e00827fbbeb70
1 file changed
+5
-1
contrib/buildsystems/CMakeLists.txt
+5
-1
@@ -374,7 +374,7 @@ endif()
374
#function checks
375
set(function_checks
376
strcasestr memmem strlcpy strtoimax strtoumax strtoull
377
- setenv mkdtemp poll pread memmem)
377
+ setenv mkdtemp poll pread memmem writev)
378
379
#unsetenv,hstrerror are incompatible with windows build
380
if(NOT WIN32)
@@ -419,6 +419,10 @@ if(NOT HAVE_MEMMEM)
419
list(APPEND compat_SOURCES compat/memmem.c)
420
endif()
421
422
+if(NOT HAVE_WRITEV)
423
+ list(APPEND compat_SOURCES compat/writev.c)
424
+endif()
425
+
426
if(NOT WIN32)
427
if(NOT HAVE_UNSETENV)
428
list(APPEND compat_SOURCES compat/unsetenv.c)