macos_mktemp_check.patch raw
1 build: fix mkdtemp check on macOS
2
3 On macOS, mkdtemp is in unistd.h. Fix the CMake check so that is works.
4 Upstreamed in https://github.com/zeromq/libzmq/pull/4668.
5
6 --- a/CMakeLists.txt
7 +++ b/CMakeLists.txt
8 @@ -599,7 +599,7 @@ if(NOT MSVC)
9
10 check_cxx_symbol_exists(fork unistd.h HAVE_FORK)
11 check_cxx_symbol_exists(gethrtime sys/time.h HAVE_GETHRTIME)
12 - check_cxx_symbol_exists(mkdtemp stdlib.h HAVE_MKDTEMP)
13 + check_cxx_symbol_exists(mkdtemp "stdlib.h;unistd.h" HAVE_MKDTEMP)
14 check_cxx_symbol_exists(accept4 sys/socket.h HAVE_ACCEPT4)
15 check_cxx_symbol_exists(strnlen string.h HAVE_STRNLEN)
16 else()
17