-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test for shared libraries with dependencies #158
base: master
Are you sure you want to change the base?
Conversation
Hm, for some reason it succeeds on Ubuntu while it should not. See e.g. https://github.com/Flamefire/locale/runs/6047203575?check_suite_focus=true where Boost.Locale links privately against Boost.Thread and then fails to find it (likely due to cleared RPath) @pdimov Any idea what I'm missing? |
I don't know. The only thing I notice is that
the runtime path of |
Possibly because atomic doesn't have any dynamic library deps so no rpath. Same for the Boost.Locale build: Clearing Locale and Thread but not Atomic. Doesn't explain the difference though -.- Maybe because no exported function from Atomic is actually used? |
Oh yes, that might well be the reason. :-) |
Hm, atomic is mostly header-only it seems. I can't really find a (public) way to call one of the few library functions on all platforms. |
033084a
to
2c9a822
Compare
Ok now it fails as expected for All shared builds of the install test |
Convert the header-only library to a compiled library which additionally depends (privately) on another compiled library (Boost.Atomic chosen as it has few other dependencies). This reproduces the runtime link failure of #155 when compiling shared libraries.
2c9a822
to
7e8379a
Compare
On Windows DLLs need to be either in PATH or in the same folder as the executable. The latter is easy to achieve by setting CMAKE_RUNTIME_OUTPUT_DIRECTORY which puts all runtime files (exe, dll, so) into the specified folder. So do that.
Avoids the repetition. Use a subfolder of /tmp which is unlikely to exist. Additionally using $HOME may cause trouble due to path translation on Windows-Bash
To find dynamic libraries which are only indirect dependencies the variable LD_LIBRARY_PATH (Linux) or PATH (Windows) must contain the folder of the binaries.
Fix CMake tests when using dynamic libraries
Convert the header-only library to a compiled library which additionally depends (privately) on another compiled library (Boost.Atomic chosen as it has few other dependencies).
This reproduces the runtime link failure of #155 when compiling shared libraries.