Use check_symbol_exists() rather than check_function_exists()

This commit is contained in:
Theo Buehler
2024-08-02 07:32:01 -06:00
parent 73ba2f0557
commit 161984f56f

View File

@@ -676,7 +676,7 @@ set_tests_properties(shutdowntest PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_D
# Emscripten does not support socketpair syscall.
if(NOT (CMAKE_SYSTEM_NAME MATCHES "WindowsStore" OR EMSCRIPTEN))
set(SIGNERTEST_SRC signertest.c)
check_function_exists(pipe2 HAVE_PIPE2)
check_symbol_exists(pipe2 "fcntl.h unistd.h" HAVE_PIPE2)
if(HAVE_PIPE2)
add_definitions(-DHAVE_PIPE2)
else()
@@ -792,7 +792,7 @@ add_platform_test(tlslegacytest tlslegacytest)
# Emscripten does not support socketpair syscall.
if(NOT (CMAKE_SYSTEM_NAME MATCHES "WindowsStore" OR EMSCRIPTEN))
set(TLSTEST_SRC tlstest.c)
check_function_exists(pipe2 HAVE_PIPE2)
check_symbol_exists(pipe2 "fcntl.h unistd.h" HAVE_PIPE2)
if(HAVE_PIPE2)
add_definitions(-DHAVE_PIPE2)
else()