Commit 2daa670ce8e56a82f61c8cbee47566c2cd139d1e

Ozkan Sezer 2020-10-13T15:20:03

cmake: look for iconv in libc, too (bug #5316.)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3a02eb6..78e4099 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -841,7 +841,10 @@ if(LIBC)
     endif()
 
     check_library_exists(iconv iconv_open "" HAVE_LIBICONV)
-    if(HAVE_LIBICONV)
+    check_library_exists(c iconv_open "" HAVE_BUILTIN_ICONV)
+    if(HAVE_BUILTIN_ICONV)
+      set(HAVE_ICONV 1)
+    elseif(HAVE_LIBICONV)
       list(APPEND EXTRA_LIBS iconv)
       set(HAVE_ICONV 1)
     endif()