diff --git a/src/config/CMakeLists.txt b/src/config/CMakeLists.txt --- a/src/config/CMakeLists.txt +++ b/src/config/CMakeLists.txt @@ -111,7 +111,8 @@ # Various system libraries check_symbol_exists(strnlen "string.h" HAVE_DECL_STRNLEN) -check_symbol_exists(daemon "unistd.h" HAVE_DECL_DAEMON) +# daemon() is located in unistd.h on linux and in stdlib.h on BSDs and macOS. +check_symbol_exists(daemon "unistd.h;stdlib.h" HAVE_DECL_DAEMON) # Check for ways to obtain entropy check_symbol_exists(getentropy "unistd.h" HAVE_GETENTROPY)