From 69ab8adb129d9fe38fbb04261686a2b95aeb3362 Mon Sep 17 00:00:00 2001 From: Jim Hague Date: Mon, 28 Oct 2019 10:36:34 +0000 Subject: [PATCH] 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. --- CMakeLists.txt | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b2cdb5a..91489e8e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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