Skip to content
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

Fix CMake tests when using dynamic libraries #162

Merged
merged 3 commits into from
Jun 22, 2023

Conversation

Flamefire
Copy link
Collaborator

On Windows DLLs need to be either in PATH or in the same folder as the executable.
On Linux either RPath is required to be set (usually cleared when installing the library) or the files need to be in LD_LIBRARY_PATH

@codecov
Copy link

codecov bot commented May 21, 2022

Codecov Report

Merging #162 (96dab18) into shared_build_test (7e8379a) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@                 Coverage Diff                 @@
##           shared_build_test      #162   +/-   ##
===================================================
  Coverage             100.00%   100.00%           
===================================================
  Files                      2         2           
  Lines                     18        18           
  Branches                   7         7           
===================================================
  Hits                      18        18           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7e8379a...96dab18. Read the comment docs.

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.
@Flamefire
Copy link
Collaborator Author

@pdimov As you were against using scripts, this would be the in-yaml solution.
Also cc @jeking3

Any comments?

@Flamefire
Copy link
Collaborator Author

Quick ping. Any comments on this solution? Especially as it is meant as a C&P solution for most (all?) Boost repos

@pdimov
Copy link
Member

pdimov commented Jun 5, 2022

I don't see anything wrong with it.

@Flamefire Flamefire merged commit bc54f0e into shared_build_test Jun 22, 2023
@Flamefire Flamefire deleted the shared_build_fix branch June 22, 2023 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants