aboutsummaryrefslogtreecommitdiff
path: root/cmake/FindLibIntl.cmake
diff options
context:
space:
mode:
authorerw7 <erw7.github@gmail.com>2020-01-28 17:56:26 +0900
committerJustin M. Keyes <justinkz@gmail.com>2020-01-28 00:56:26 -0800
commit4d0dfb8f7581a0bce6cf161580d5efe5ab5004fc (patch)
tree0bec69a460d4e4f3b9551cc790a4a1a0abb7167c /cmake/FindLibIntl.cmake
parentd3a9d75c0462fea7b00e639d1b324bcf08a8b02d (diff)
downloadrneovim-4d0dfb8f7581a0bce6cf161580d5efe5ab5004fc.tar.gz
rneovim-4d0dfb8f7581a0bce6cf161580d5efe5ab5004fc.tar.bz2
rneovim-4d0dfb8f7581a0bce6cf161580d5efe5ab5004fc.zip
build/MSVC: fix gettext multibyte issue #11774
Problem: On Windows with the MSVC build, gettext-translation "Questa è già la" displays as "Questa <e8> gi<e0> la". Solution: Fix iconv detection iconv when building gettext. So HAVE_ICONV is correctly defined when building nvim. * fix gettext mb chars on MSVC * fix libintl detection failure on MSVC fixes #11749
Diffstat (limited to 'cmake/FindLibIntl.cmake')
-rw-r--r--cmake/FindLibIntl.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmake/FindLibIntl.cmake b/cmake/FindLibIntl.cmake
index 5663098147..09eafb786a 100644
--- a/cmake/FindLibIntl.cmake
+++ b/cmake/FindLibIntl.cmake
@@ -38,6 +38,9 @@ endif()
if (LibIntl_LIBRARY)
list(APPEND CMAKE_REQUIRED_LIBRARIES "${LibIntl_LIBRARY}")
endif()
+if (MSVC)
+ list(APPEND CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY})
+endif()
check_c_source_compiles("
#include <libintl.h>
@@ -48,6 +51,9 @@ int main(int argc, char** argv) {
bind_textdomain_codeset(\"foo\", \"bar\");
textdomain(\"foo\");
}" HAVE_WORKING_LIBINTL)
+if (MSVC)
+ list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY})
+endif()
if (LibIntl_INCLUDE_DIR)
list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES "${LibIntl_INCLUDE_DIR}")
endif()