build/MSVC: Fix HAVE_ICONV_H #10697

Problem: HAVE_ICONV_H is not true in MSVC
Solution: Since iconv.h does not exist in the standard include directory
in MSVC, CMAKE_REQUIRED_INCLUDES must be set.

Note: This will be unnecessary after #10708.
This commit is contained in:
erw7
2019-08-08 19:06:02 +09:00
committed by Justin M. Keyes
parent 1896c72a54
commit 2e01e7ce8a

View File

@@ -20,7 +20,13 @@ endif()
check_symbol_exists(_NSGetEnviron crt_externs.h HAVE__NSGETENVIRON)
# Headers
if(ICONV_INCLUDE_DIR)
list(APPEND CMAKE_REQUIRED_INCLUDES "${ICONV_INCLUDE_DIR}")
endif()
check_include_files(iconv.h HAVE_ICONV_H)
if(ICONV_INCLUDE_DIR)
list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES "${ICONV_INCLUDE_DIR}")
endif()
check_include_files(langinfo.h HAVE_LANGINFO_H)
check_include_files(locale.h HAVE_LOCALE_H)
check_include_files(pwd.h HAVE_PWD_H)