]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: fix `HAVE_H_ERRNO_ASSIGNABLE` detection
authorViktor Szakats <commit@vsz.me>
Wed, 11 Oct 2023 16:06:12 +0000 (16:06 +0000)
committerViktor Szakats <commit@vsz.me>
Thu, 12 Oct 2023 06:46:21 +0000 (06:46 +0000)
Fix `HAVE_H_ERRNO_ASSIGNABLE` to not run, only compile its test snippet,
aligning this with autotools. This fixes an error when doing
cross-builds and also actually detects this feature. It affected systems
not allowlisted into this, e.g. SerenityOS.

We used this detection result to enable `HAVE_GETADDRINFO_THREADSAFE`.

Follow-up to 04a3a377d83fd72c4cf7a96c9cb6d44785e33264 #11979
Ref: #12095 (closed in favour of this patch)
Ref: #11964 (effort to sync cmake detections with autotools)

Reported-by: Kartatz on Github
Assisted-by: Kartatz on Github
Fixes #12093
Closes #12094

CMake/OtherTests.cmake

index d67a9059bcdeaab9738f000c314aca50964faf5b..f1902d73a31f54263a41f7d938e8e9a43d96daca 100644 (file)
@@ -172,7 +172,7 @@ if(NOT DEFINED HAVE_GETADDRINFO_THREADSAFE)
     }" HAVE_H_ERRNO)
 
   if(NOT HAVE_H_ERRNO)
-    check_c_source_runs("${_source_epilogue}
+    check_c_source_compiles("${_source_epilogue}
       int main(void)
       {
         h_errno = 2;