mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 09:39:46 -06:00
CMake: Use find_package and imported targets for Iconv
Fixes us forgetting to add its include directories, which could result in linking to a dylib from MacPorts while using the system's header, and failing to link because they use different function names
This commit is contained in:
@ -914,19 +914,16 @@ else()
|
||||
include_directories(BEFORE Externals/curl/include)
|
||||
endif()
|
||||
|
||||
if (NOT ANDROID)
|
||||
find_library(ICONV_LIBRARIES NAMES iconv libiconv libiconv-2 c)
|
||||
find_path(ICONV_INCLUDE_DIR NAMES iconv.h)
|
||||
if(NOT ANDROID)
|
||||
find_package(Iconv)
|
||||
endif()
|
||||
|
||||
if (NOT ANDROID AND ICONV_LIBRARIES AND ICONV_INCLUDE_DIR)
|
||||
mark_as_advanced(ICONV_INCLUDE_DIR ICONV_LIBRARIES)
|
||||
if(TARGET Iconv::Iconv)
|
||||
message(STATUS "Using shared iconv")
|
||||
else()
|
||||
check_vendoring_approved(iconv)
|
||||
message(STATUS "Using static iconv from Externals")
|
||||
include_directories(Externals/libiconv-1.14/include)
|
||||
add_subdirectory(Externals/libiconv-1.14)
|
||||
set(ICONV_LIBRARIES iconv)
|
||||
endif()
|
||||
|
||||
if(NOT ANDROID)
|
||||
|
Reference in New Issue
Block a user