Allow user to disable use of libidn/idn2.

It's tempting to do the same for libunbound, but that's only pulled in if you're not building stub-only, and in that case there is no choice - you have to have libunbound.
This commit is contained in:
Jim Hague 2019-10-28 10:36:34 +00:00
parent 5df3bc4fce
commit 69ab8adb12
1 changed files with 13 additions and 6 deletions

View File

@ -108,6 +108,9 @@ option(BUILD_GETDNS_QUERY "Compile and install the getdns_query tool." ON)
option(BUILD_GETDNS_SERVER_MON "Compile and install the getdns_server_mon tool." ON)
option(BUILD_STUBBY "Compile and install stubby, the (stub) resolver daemon." OFF)
option(USE_LIBIDN "Use libidn if available." ON)
option(USE_LIBIDN2 "Use libidn2 if available." ON)
# Above names chosen for user consistency. Now define substituted names.
set(REQ_DEBUG ${ENABLE_DEBUG_REQ})
set(SCHED_DEBUG ${ENABLE_DEBUG_SCHED})
@ -321,15 +324,19 @@ else ()
endif ()
# Libidn
find_package(Libidn)
if (Libidn_FOUND)
set(HAVE_LIBIDN 1)
if (USE_LIBIDN)
find_package(Libidn)
if (Libidn_FOUND)
set(HAVE_LIBIDN 1)
endif()
endif()
# Libidn2
find_package(Libidn2 "2.0.0")
if (Libidn2_FOUND)
set(HAVE_LIBIDN2 1)
if (USE_LIBIDN2)
find_package(Libidn2 "2.0.0")
if (Libidn2_FOUND)
set(HAVE_LIBIDN2 1)
endif()
endif()
# Stuff that might be in a BSD library