]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: Add an option to disable libidn2
authorJay Satiro <raysatiro@yahoo.com>
Tue, 22 Dec 2020 20:31:03 +0000 (15:31 -0500)
committerJay Satiro <raysatiro@yahoo.com>
Sat, 9 Jan 2021 03:36:43 +0000 (22:36 -0500)
New option USE_LIBIDN2 defaults to ON for libidn2 detection. Prior to
this change libidn2 detection could not be turned off in cmake builds.

Reported-by: William A Rowe Jr
Fixes https://github.com/curl/curl/issues/6361
Closes https://github.com/curl/curl/pull/6362

CMakeLists.txt

index 7c26e2dcf4596c1b8780bce1cff47c1686871cc3..58f4bfb7c755672c27d956a998019659b4f6396c 100644 (file)
@@ -618,7 +618,11 @@ if(NOT CURL_DISABLE_LDAPS)
 endif()
 
 # Check for idn
-check_library_exists_concat("idn2" idn2_lookup_ul HAVE_LIBIDN2)
+option(USE_LIBIDN2 "Use libidn2 for IDN support" ON)
+set(HAVE_LIBIDN2 OFF)
+if(USE_LIBIDN2)
+  check_library_exists_concat("idn2" idn2_lookup_ul HAVE_LIBIDN2)
+endif()
 
 # Check for symbol dlopen (same as HAVE_LIBDL)
 check_library_exists("${CURL_LIBS}" dlopen "" HAVE_DLOPEN)