Use compile-time test instead of relying on testing the cURL version
at runtime. This is done to make cross-compilation possible again.
---
 meson.build | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/meson.build b/meson.build
index 8c3609afe..99ab1ba14 100644
--- a/meson.build
+++ b/meson.build
@@ -194,14 +194,17 @@ if not curl_dep.found()
     curl_dep = cc.find_library('curl', required: true)
     curl_version_check = '''#include <curl/curl.h>
   int main(int argc, char **argv) {
-    return (LIBCURL_VERSION_NUM >= 0x075500) ? 0 : 1;
+    #if LIBCURL_VERSION_NUM < 0x075500
+      #error "cURL version >= 7.85.0 required"
+    #endif
+    return 0;
     }
   '''
-    if cc.run(
+    if not cc.compiles(
         curl_version_check,
         name: 'cURL version check',
         dependencies: curl_dep,
-    ).returncode() != 0
+    )
         error('cURL version >=7.85.0 required')
     endif
 endif
-- 
2.51.0

Attachment: signature.asc
Description: PGP signature

Reply via email to