Allow to force use of external iconv

This commit is contained in:
Martchus 2017-07-20 01:25:13 +02:00
parent 73f11eeb2a
commit 326551ee02
1 changed files with 7 additions and 4 deletions

View File

@ -208,10 +208,13 @@ if(NOT DEFINED THIRD_PARTY_MODULE_LOADED)
endmacro() endmacro()
macro(use_iconv LINKAGE REQUIRED) macro(use_iconv LINKAGE REQUIRED)
# check whether iconv exists in the standard library set(FORCE_EXTERNAL_ICONV OFF CACHE PATH "whether to force usage of external iconv (rather than the using the one bundled with glibc)")
include(CheckFunctionExists) if(NOT FORCE_EXTERNAL_ICONV)
check_function_exists(iconv HAS_ICONV) # check whether iconv exists in standard lib
if(HAS_ICONV) include(CheckFunctionExists)
check_function_exists(iconv HAS_ICONV)
endif()
if(NOT FORCE_EXTERNAL_ICONV AND HAS_ICONV)
message(STATUS "Using iconv from the standard library for ${META_PROJECT_NAME}.") message(STATUS "Using iconv from the standard library for ${META_PROJECT_NAME}.")
else() else()
# find external iconv library # find external iconv library