summaryrefslogtreecommitdiffstats
path: root/Utilities/cmcurl
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-05-19 17:25:54 (GMT)
committerBrad King <brad.king@kitware.com>2020-05-20 19:17:26 (GMT)
commit0a46eb11af88d2d50c90888c95860fa5f736f0d8 (patch)
tree86b44ea2f894feda29677ee36d6652bd6cf77e20 /Utilities/cmcurl
parent2f3a356ea8dd8305ce4360c1652e2e5abfa9f1cf (diff)
downloadCMake-0a46eb11af88d2d50c90888c95860fa5f736f0d8.zip
CMake-0a46eb11af88d2d50c90888c95860fa5f736f0d8.tar.gz
CMake-0a46eb11af88d2d50c90888c95860fa5f736f0d8.tar.bz2
curl: Avoid checking 'send' and 'recv' signatures
cURL detects the `send` and `recv` signatures using a large loop of `try_compile` checks. The results are used for the following: * Casting argument types in calls to `send` and `recv`, perhaps to avoid conversion warnings. We compile with `-w` anyway. * Providing debug variants for `CURLDEBUG`, which we do not use. Replace the detection loops with hard-coded results that should work well enough everywhere. This significantly reduces the number of configure-time checks for building CMake on some platforms.
Diffstat (limited to 'Utilities/cmcurl')
-rw-r--r--Utilities/cmcurl/CMake/OtherTests.cmake17
1 files changed, 17 insertions, 0 deletions
diff --git a/Utilities/cmcurl/CMake/OtherTests.cmake b/Utilities/cmcurl/CMake/OtherTests.cmake
index 8b15029..30315dc 100644
--- a/Utilities/cmcurl/CMake/OtherTests.cmake
+++ b/Utilities/cmcurl/CMake/OtherTests.cmake
@@ -26,6 +26,13 @@ endif()
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
+if(1) # CMake hard-codes these
+ set(RECV_TYPE_ARG1 "curl_socket_t")
+ set(RECV_TYPE_ARG2 "char *")
+ set(RECV_TYPE_ARG3 "size_t")
+ set(RECV_TYPE_ARG4 "int")
+ set(RECV_TYPE_RETV "ssize_t")
+else()
check_c_source_compiles("${_source_epilogue}
int main(void) {
recv(0, 0, 0, 0);
@@ -88,8 +95,17 @@ else()
message(FATAL_ERROR "Unable to link function recv")
endif()
set(curl_cv_func_recv_args "${curl_cv_func_recv_args}" CACHE INTERNAL "Arguments for recv")
+endif()
set(HAVE_RECV 1)
+if(1) # CMake hard-codes these
+ set(SEND_QUAL_ARG2 " ")
+ set(SEND_TYPE_ARG1 "curl_socket_t")
+ set(SEND_TYPE_ARG2 "char *")
+ set(SEND_TYPE_ARG3 "size_t")
+ set(SEND_TYPE_ARG4 "int")
+ set(SEND_TYPE_RETV "ssize_t")
+else()
check_c_source_compiles("${_source_epilogue}
int main(void) {
send(0, 0, 0, 0);
@@ -156,6 +172,7 @@ else()
message(FATAL_ERROR "Unable to link function send")
endif()
set(curl_cv_func_send_args "${curl_cv_func_send_args}" CACHE INTERNAL "Arguments for send")
+endif()
set(HAVE_SEND 1)
check_c_source_compiles("${_source_epilogue}