summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorViktor Szakats <commit@vsz.me>2022-10-14 18:06:30 +0000
committerViktor Szakats <commit@vsz.me>2022-10-14 18:06:30 +0000
commit790779fc3444a5cbf0208dd8b06785bea7f25681 (patch)
tree652b6d5f88805bd8961eef7fae5e4b379fb99828 /CMakeLists.txt
parent1d64a2bf5b46f0639cc07e674bf502cbd16c391d (diff)
downloadcurl-790779fc3444a5cbf0208dd8b06785bea7f25681.tar.gz
cmake: sync HAVE_SIGNAL detection with autotools
`HAVE_SIGNAL` means the availability of the `signal()` function in autotools, while in CMake it meant the availability of that function _and_ the symbol `SIGALRM`. The latter is not available on Windows, but the function is, which means on Windows, autotools did define `HAVE_SIGNAL`, but CMake did not, introducing a slight difference into the binaries. This patch syncs CMake behaviour with autotools to look for the function only. The logic came with the initial commit adding CMake support to curl, so the commit history doesn't reveal the reason behind it. In any case, it's best to check the existence of `SIGALRM` directly in the source before use. For now, curl builds fine with `HAVE_SIGNAL` enabled and `SIGALRM` missing. Follow-up to 68fa9bf3f5d7b4fcbb57619f70cb4aabb79a51f6 Closes #9725
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt6
1 files changed, 1 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 70ef457cf..e1704e34a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1039,11 +1039,7 @@ check_symbol_exists(gmtime_r "${CURL_INCLUDES}" HAVE_GMTIME_R)
check_symbol_exists(gethostbyname_r "${CURL_INCLUDES}" HAVE_GETHOSTBYNAME_R)
-check_symbol_exists(signal "${CURL_INCLUDES}" HAVE_SIGNAL_FUNC)
-check_symbol_exists(SIGALRM "${CURL_INCLUDES}" HAVE_SIGNAL_MACRO)
-if(HAVE_SIGNAL_FUNC AND HAVE_SIGNAL_MACRO)
- set(HAVE_SIGNAL 1)
-endif()
+check_symbol_exists(signal "${CURL_INCLUDES}" HAVE_SIGNAL)
check_symbol_exists(strtoll "${CURL_INCLUDES}" HAVE_STRTOLL)
check_symbol_exists(_strtoi64 "${CURL_INCLUDES}" HAVE__STRTOI64)
check_symbol_exists(strerror_r "${CURL_INCLUDES}" HAVE_STRERROR_R)