Re: Check for hunspell.hxx always fails

2019-11-29 Thread Kornel Benko
Am Fri, 29 Nov 2019 13:04:48 +0100
schrieb pdv :

> > The try_compile() normally creates an executable (e.g. compile + link)
> > and we want to compile only here.  
> 
> I thought so (and I suppose libhunspell is then also not needed by LyX, 
> which I did not realize), but that doesn't work for me; without the 
> LINK_LIBRARIES the build fails:
> 
> Undefined symbols for architecture x86_64:
>"Hunspell::stem(std::__1::basic_string std::__1::char_traits, std::__1::allocator > const&)", 
> referenced from:
>_main in hunspelltest.o
>"Hunspell::Hunspell(char const*, char const*, char const*)", 
> referenced from:
>_main in hunspelltest.o.
>"Hunspell::~Hunspell()", referenced from:
>_main in hunspelltest.o
> ld: symbol(s) not found for architecture x86_64
> 
> It has been reported that this trick does not work with XCode:
> https://cmake.org/pipermail/cmake/2010-May/037132.html
> 

I see. Committed at 350a9daf

Kornel


pgpZGtp9wNzMy.pgp
Description: Digitale Signatur von OpenPGP
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Check for hunspell.hxx always fails

2019-11-29 Thread pdv

On 28/11/2019 14:22, Kornel Benko wrote:

Am Thu, 28 Nov 2019 13:38:26 +0100
schrieb pdv :


Right now the check for the presence of hunspell.hxx in
ConfigureChecks.cmake always fails for me (MacOS10.14, master build)
with the result `HAVE_HUNSPELL_CXXABI = FALSE`, although hunspell.hxx is
available. That's a minor issue since hunspell works anyway, but the
check seems useless now.


Where is it available? Here, on ubuntu, it is under 
/usr/include/hunspell/hunspell.hxx


I use the macports one /opt/local/include/hunspell
but it also works with the 3thparty one included with lyx.




To proceed the check should include a `LINK_LIBRARIES` entry in the
try_compile() step.


No, not needed, see below ...


Also the `hunspell` in the `#include
` instruction in the test file should be removed.
It should be included in the `HUNSPELL_INCLUDE_DIR` definition.


Good point.


With these changes `HAVE_HUNSPELL_CXXABI = TRUE` (supposed hunspell.hxx
is present).

I don't understand the
"-DCMAKE_CXX_LINK_EXECUTABLE='${CMAKE_COMMAND} echo not linking now...'"
entry which contained a typo anyway. It sounds like one wanted to avoid
the linking in which case the LINK_LIBRARIES is indeed not needed.



The try_compile() normally creates an executable (e.g. compile + link)
and we want to compile only here.


I thought so (and I suppose libhunspell is then also not needed by LyX, 
which I did not realize), but that doesn't work for me; without the 
LINK_LIBRARIES the build fails:


Undefined symbols for architecture x86_64:
  "Hunspell::stem(std::__1::basic_stringstd::__1::char_traits, std::__1::allocator > const&)", 
referenced from:

  _main in hunspelltest.o
  "Hunspell::Hunspell(char const*, char const*, char const*)", 
referenced from:

  _main in hunspelltest.o
  "Hunspell::~Hunspell()", referenced from:
  _main in hunspelltest.o
ld: symbol(s) not found for architecture x86_64

It has been reported that this trick does not work with XCode:
https://cmake.org/pipermail/cmake/2010-May/037132.html





Patrick


Kornel





--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Check for hunspell.hxx always fails

2019-11-28 Thread Kornel Benko
Am Thu, 28 Nov 2019 13:38:26 +0100
schrieb pdv :

> Right now the check for the presence of hunspell.hxx in 
> ConfigureChecks.cmake always fails for me (MacOS10.14, master build) 
> with the result `HAVE_HUNSPELL_CXXABI = FALSE`, although hunspell.hxx is 
> available. That's a minor issue since hunspell works anyway, but the 
> check seems useless now.

Where is it available? Here, on ubuntu, it is under 
/usr/include/hunspell/hunspell.hxx

> To proceed the check should include a `LINK_LIBRARIES` entry in the 
> try_compile() step.

No, not needed, see below ...

> Also the `hunspell` in the `#include 
> ` instruction in the test file should be removed. 
> It should be included in the `HUNSPELL_INCLUDE_DIR` definition.

Good point.

> With these changes `HAVE_HUNSPELL_CXXABI = TRUE` (supposed hunspell.hxx 
> is present).
> 
> I don't understand the
> "-DCMAKE_CXX_LINK_EXECUTABLE='${CMAKE_COMMAND} echo not linking now...'"
> entry which contained a typo anyway. It sounds like one wanted to avoid 
> the linking in which case the LINK_LIBRARIES is indeed not needed.
> 

The try_compile() normally creates an executable (e.g. compile + link)
and we want to compile only here.

> 
> Patrick

Kornel


pgp05omDlaeEy.pgp
Description: Digitale Signatur von OpenPGP
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Check for hunspell.hxx always fails

2019-11-28 Thread pdv
Right now the check for the presence of hunspell.hxx in 
ConfigureChecks.cmake always fails for me (MacOS10.14, master build) 
with the result `HAVE_HUNSPELL_CXXABI = FALSE`, although hunspell.hxx is 
available. That's a minor issue since hunspell works anyway, but the 
check seems useless now.


To proceed the check should include a `LINK_LIBRARIES` entry in the 
try_compile() step. Also the `hunspell` in the `#include 
` instruction in the test file should be removed. 
It should be included in the `HUNSPELL_INCLUDE_DIR` definition.


With these changes `HAVE_HUNSPELL_CXXABI = TRUE` (supposed hunspell.hxx 
is present).


I don't understand the
"-DCMAKE_CXX_LINK_EXECUTABLE='${CMAKE_COMMAND} echo not linking now...'"
entry which contained a typo anyway. It sounds like one wanted to avoid 
the linking in which case the LINK_LIBRARIES is indeed not needed.




Patrick
diff --git a/development/cmake/ConfigureChecks.cmake 
b/development/cmake/ConfigureChecks.cmake
index 4b126776ea..b78d8ef14e 100644
--- a/development/cmake/ConfigureChecks.cmake
+++ b/development/cmake/ConfigureChecks.cmake
@@ -77,7 +77,7 @@ if(HUNSPELL_FOUND)
   set(HunspellTestFile "${CMAKE_BINARY_DIR}/hunspelltest.cpp")
   file(WRITE "${HunspellTestFile}"
   "
-  #include 
+  #include 
 
   int main()
   {
@@ -93,7 +93,9 @@ if(HUNSPELL_FOUND)
 "${HunspellTestFile}"
 CMAKE_FLAGS
   "-DINCLUDE_DIRECTORIES:STRING=${HUNSPELL_INCLUDE_DIR}"
-  "-DCMAKE_CXX_LINK_EXECUTABLE='${CMAKE_COMMAD} echo not linking now...'"
+  "-DCMAKE_CXX_LINK_EXECUTABLE='${CMAKE_COMMAND} echo not linking now...'"
+LINK_LIBRARIES
+  "${HUNSPELL_LIBRARY}"
   OUTPUT_VARIABLE  LOG2)
 
   message(STATUS "HAVE_HUNSPELL_CXXABI = ${HAVE_HUNSPELL_CXXABI}")
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel