From e6d53c53c9b89ae4d35a2ba038380a7c6f228e6c Mon Sep 17 00:00:00 2001 From: fanquake Date: Mon, 25 Mar 2024 12:15:01 +0000 Subject: [PATCH] build: fix mkdtemp check on macOS On macOS, mkdtemp is in unistd.h. Fix the CMake check so that is works. This was discovered when comparing the output of the Autotools an CMake build systems. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c124a6a4a6..200a82e5fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -605,7 +605,7 @@ if(NOT MSVC) check_cxx_symbol_exists(fork unistd.h HAVE_FORK) check_cxx_symbol_exists(gethrtime sys/time.h HAVE_GETHRTIME) - check_cxx_symbol_exists(mkdtemp stdlib.h HAVE_MKDTEMP) + check_cxx_symbol_exists(mkdtemp "stdlib.h;unistd.h" HAVE_MKDTEMP) check_cxx_symbol_exists(accept4 sys/socket.h HAVE_ACCEPT4) check_cxx_symbol_exists(strnlen string.h HAVE_STRNLEN) else()