2020-12-23 15:19:50 +08:00
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
2024-01-03 06:32:00 +08:00
|
|
|
index a54c2ff..3b83a7f 100644
|
2020-12-23 15:19:50 +08:00
|
|
|
--- a/CMakeLists.txt
|
|
|
|
+++ b/CMakeLists.txt
|
2024-04-24 22:57:12 +08:00
|
|
|
@@ -852,11 +852,11 @@ endif()
|
2022-07-06 05:57:47 +08:00
|
|
|
# Check for idn2
|
2021-08-12 10:38:08 +08:00
|
|
|
option(USE_LIBIDN2 "Use libidn2 for IDN support" ON)
|
|
|
|
if(USE_LIBIDN2)
|
2024-01-03 06:32:00 +08:00
|
|
|
- check_library_exists("idn2" "idn2_lookup_ul" "" HAVE_LIBIDN2)
|
|
|
|
- if(HAVE_LIBIDN2)
|
|
|
|
- set(CURL_LIBS "idn2;${CURL_LIBS}")
|
|
|
|
- check_include_file_concat("idn2.h" HAVE_IDN2_H)
|
|
|
|
- endif()
|
2024-04-24 22:57:12 +08:00
|
|
|
+ find_package(PkgConfig REQUIRED)
|
|
|
|
+ pkg_check_modules(LIBIDN2 REQUIRED libidn2)
|
2021-08-12 10:38:08 +08:00
|
|
|
+ set(HAVE_LIBIDN2 TRUE)
|
2022-01-20 01:15:16 +08:00
|
|
|
+ list(INSERT CURL_LIBS 0 ${LIBIDN2_LINK_LIBRARIES})
|
2024-04-16 01:43:14 +08:00
|
|
|
+ set(HAVE_IDN2_H TRUE)
|
2022-07-06 05:57:47 +08:00
|
|
|
else()
|
|
|
|
set(HAVE_LIBIDN2 OFF)
|
2020-12-23 15:19:50 +08:00
|
|
|
endif()
|