From 8774ad51c01938d66d6e014dd31b858c1608edbb Mon Sep 17 00:00:00 2001 From: Kornel Benko Date: Thu, 29 Mar 2018 22:53:59 +0200 Subject: [PATCH] Adapt to new hunspell C++ ABI for cmake The compile test for 3rdparty hunspell is omitted, because the macro check_cxx_source_compiles() tries also to link. But at the time of the check, the required library is not there. --- development/cmake/ConfigureChecks.cmake | 19 +++++++++++++++++++ development/cmake/configCompiler.h.cmake | 3 +++ 2 files changed, 22 insertions(+) diff --git a/development/cmake/ConfigureChecks.cmake b/development/cmake/ConfigureChecks.cmake index d998e5b826..9618d5d2ef 100644 --- a/development/cmake/ConfigureChecks.cmake +++ b/development/cmake/ConfigureChecks.cmake @@ -72,6 +72,25 @@ check_type_size("long long" HAVE_LONG_LONG) check_type_size(wchar_t HAVE_WCHAR_T) check_type_size(wint_t HAVE_WINT_T) +# check whether hunspell C++ (rather than C) ABI is provided +if(LYX_EXTERNAL_HUNSPELL) + set(CMAKE_REQUIRED_INCLUDES ${HUNSPELL_INCLUDE_DIR}) + set(CMAKE_REQUIRED_LIBRARIES ${HUNSPELL_LIBRARY}) + check_cxx_source_compiles( + " + #include + int main() + { + Hunspell sp(\"foo\", \"bar\"); + int i = sp.stem(\"test\").size(); + return(0); + } + " + HAVE_HUNSPELL_CXXABI) +else() + # Not compiling the 3rdparty source, because ${HUNSPELL_LIBRARY} does not exists yet to link with + set(HAVE_HUNSPELL_CXXABI 1 CACHE BOOL "whether hunspell C++ (rather than C) ABI is provided") +endif() #check_cxx_source_compiles( # " diff --git a/development/cmake/configCompiler.h.cmake b/development/cmake/configCompiler.h.cmake index 52f629e7bb..8934986cb0 100644 --- a/development/cmake/configCompiler.h.cmake +++ b/development/cmake/configCompiler.h.cmake @@ -66,6 +66,9 @@ #define HAVE_ALLOCA #endif +/* whether hunspell C++ (rather than C) ABI is provided */ +#cmakedefine HAVE_HUNSPELL_CXXABI 1 + #cmakedefine HAVE_ICONV_CONST 1 #ifdef HAVE_ICONV_CONST #define ICONV_CONST const -- 2.39.5