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

Ozkan Sezer 2020-10-13 15:20:03 +03:00
parent 6756851836
commit 2daa670ce8
1 changed files with 4 additions and 1 deletions

View File

@ -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()