Browse Source

[ios] Fix failing to link iconv when build using CMake

Anders Jenbo 3 years ago
parent
commit
d68b429cfb
1 changed files with 6 additions and 4 deletions
  1. 6 4
      CMakeLists.txt

+ 6 - 4
CMakeLists.txt

@@ -914,12 +914,14 @@ if(SDL_LIBC)
     endif()
     endif()
 
 
     check_library_exists(iconv iconv_open "" HAVE_LIBICONV)
     check_library_exists(iconv iconv_open "" HAVE_LIBICONV)
-    check_library_exists(c iconv_open "" HAVE_BUILTIN_ICONV)
-    if(HAVE_BUILTIN_ICONV)
-      set(HAVE_ICONV 1)
-    elseif(HAVE_LIBICONV)
+    if(HAVE_LIBICONV)
       list(APPEND EXTRA_LIBS iconv)
       list(APPEND EXTRA_LIBS iconv)
       set(HAVE_ICONV 1)
       set(HAVE_ICONV 1)
+    else()
+      check_library_exists(c iconv_open "" HAVE_BUILTIN_ICONV)
+      if(HAVE_BUILTIN_ICONV)
+        set(HAVE_ICONV 1)
+      endif()
     endif()
     endif()
 
 
     if(NOT APPLE)
     if(NOT APPLE)