From e41615c71df642f930b50727c5baf513d0ade966 Mon Sep 17 00:00:00 2001 From: Klemens Nanni Date: Sun, 22 May 2022 04:09:18 +0200 Subject: [PATCH] Add include path for and link against Iconv `src/util/File.cpp` calls iconv_open(3) unconditionally on (!WIN && !MAC && !ANDROID). Thus all UNIX platforms will use iconv. On OpenBSD, the build immediately fails because `` is not in the default include path. Signed-off-by: Klemens Nanni --- CMakeLists.txt | 3 +++ src/CMakeLists.txt | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 770711c6..724a52d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,6 +48,9 @@ if(UNIX AND NOT APPLE) find_package(PkgConfig) pkg_check_modules(MINIZIP minizip IMPORTED_TARGET minizip<2.0.0) endif() +if(NOT WIN32 AND NOT APPLE AND NOT ANDROID) + find_package(Iconv REQUIRED) +endif() find_package(SWIG) find_package(JNI) find_package(Python3 COMPONENTS Interpreter Development) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f5a75a5c..11c5b831 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -177,6 +177,12 @@ target_include_directories(digidocpp_priv PUBLIC ${XSD_INCLUDE_DIR} ) +if(NOT WIN32 AND NOT APPLE AND NOT ANDROID) + target_link_libraries(digidocpp_util + Iconv::Iconv + ) +endif() + target_link_libraries(digidocpp_priv digidocpp_util XmlSecurityC::XmlSecurityC