diff options
Diffstat (limited to 'cmake/FindIconv.cmake')
-rw-r--r-- | cmake/FindIconv.cmake | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/cmake/FindIconv.cmake b/cmake/FindIconv.cmake index d96e3c0..a30f1fd 100644 --- a/cmake/FindIconv.cmake +++ b/cmake/FindIconv.cmake @@ -71,6 +71,11 @@ endif() set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR}) set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY}) + +if(MSVC_VERSION GREATER 1800) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} legacy_stdio_definitions.lib) +endif() + check_cxx_source_compiles( "#include <iconv.h> int main() { @@ -91,6 +96,10 @@ if(ICONV_FOUND) set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR}) set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES}) + if(MSVC_VERSION GREATER 1800) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} legacy_stdio_definitions.lib) + endif() + if (NOT DEFINED ICONV_ACCEPTS_NONCONST_INPUT) # Display a useful message first time we come through here message(STATUS "One (and only one) of the ICONV_ACCEPTS_... tests must pass") |