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

return static libraries required for linking #149

Open
aboseley opened this issue Mar 21, 2022 · 1 comment
Open

return static libraries required for linking #149

aboseley opened this issue Mar 21, 2022 · 1 comment

Comments

@aboseley
Copy link

aboseley commented Mar 21, 2022

After building a static library it would be great if we could get the required list of libraries that need to be passed to the rust linker. If the cmake files use targets this info will be available.

@aboseley aboseley changed the title return list static librarys for linking return static librarys required for linking Mar 21, 2022
@aboseley aboseley changed the title return static librarys required for linking return static libraries required for linking Mar 21, 2022
@n-prat
Copy link

n-prat commented Mar 22, 2022

I had the same issue and what I ended up is:

It works, and is reasonably resilient (ie OK for both local and system libs, STATIC and SHARED) but it is a messy way to workaround the lack of communication between rust and CMake.

IMPORTANT: if you want to link with IMPORTED lib ie all those coming from find_package (eg Boost) you MUST set them GLOBAL eg set_target_properties(Boost::filesystem PROPERTIES IMPORTED_GLOBAL TRUE)

I would happily take a cleaner approach if there is one I have missed!

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

No branches or pull requests

2 participants