From 6b80cc4181dc73a061b049e3283e6e2d8a4e5346 Mon Sep 17 00:00:00 2001 From: Thomas Braun Date: Wed, 27 Jul 2016 20:00:40 +0200 Subject: CMAKE: Fix building on Windows with VS 2015 See https://msdn.microsoft.com/library/bb531344.aspx. Signed-off-by: Thomas Braun --- cmake/FindIconv.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) 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 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") -- cgit v0.12