From 871208e9914b43b4e3257d9076fde90cc5388cf4 Mon Sep 17 00:00:00 2001 From: Kyle Date: Thu, 5 Sep 2024 13:53:14 +0800 Subject: [PATCH] Fix iconv link issue --- cmake/FindIntlIconv.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/FindIntlIconv.cmake b/cmake/FindIntlIconv.cmake index 9e6ded99d..07959ca1a 100644 --- a/cmake/FindIntlIconv.cmake +++ b/cmake/FindIntlIconv.cmake @@ -15,6 +15,12 @@ find_path(ICONV_INCLUDE_DIR iconv.h) check_function_exists(iconv_open libc_has_iconv) find_library(iconv_lib NAMES iconv libiconv libiconv-2 c) +# workaround the iOS issue where iconv is provided by libc +# We set it to false to force it add -liconv to the linker flags +if(CMAKE_SYSTEM_NAME MATCHES "iOS") + set(libc_has_iconv FALSE) +endif() + if(ICONV_INCLUDE_DIR AND libc_has_iconv) set(ICONV_FOUND TRUE) set(ICONV_LIBRARIES "")