Ensure rpath is used for libgeos_c.so#1436
Conversation
This ensures each C library links to its corresponding C++ library Closes libgeosGH-1435
|
This would need to be backported up to 3.8 branch |
|
|
||
| set_target_properties(geos_c PROPERTIES VERSION ${CAPI_VERSION}) | ||
| # See https://github.com/libgeos/geos/issues/1435 | ||
| set_target_properties(geos_c PROPERTIES INSTALL_RPATH "\$ORIGIN") |
There was a problem hiding this comment.
Perhaps I'm overthinking it, but it might be better to structure this similar to geosop:
geos/util/geosop/CMakeLists.txt
Lines 28 to 36 in cf85984
which would allow
CMAKE_INSTALL_RPATH to override this (if needed) from a command line configuration.As for the macOS handling, I'm unsure (as I'm aware you are) how to go with, as I can only read what others have done (e.g. here); probably go with
"@loader_path". Or just handle if(NOT APPLE) to side-step macOS (mis-)configuration.
There was a problem hiding this comment.
Thanks for the review, pushed handling of override and APPLE
|
I'm unsure why things "just work" on MacOS (or why @strk seems uniquely to have problems with Linux? none of this stuff is net new or recently changed). While the |
|
Ah, I see now that in MacOS, the geos_c library is inheriting an |
|
@pramsey the problem arose in php-geos CI recipe, which installs many different versions of GEOS in different paths, but it never needed to set LD_LIBRARY_PATH when GEOS was installed with automake, as the RPATH was written in the libgeos_c.so itself. I guess there are not many people installing multiple GEOS versions and those who do maybe prefer using a workaround rather than reporting a regression (this is a regression). |
This ensures each C library links to its corresponding C++ library
Closes GH-1435