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

flecs needs an explicit usage file #31488

Closed
dg0yt opened this issue May 17, 2023 · 2 comments · Fixed by #31501
Closed

flecs needs an explicit usage file #31488

dg0yt opened this issue May 17, 2023 · 2 comments · Fixed by #31501
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@dg0yt
Copy link
Contributor

dg0yt commented May 17, 2023

Suggesting target_link_libraries(main PRIVATE flecs::flecs flecs::flecs_static) only works in vcpkg. Outside vcpkg either one target will be missing, or the user will link two libs providing the same symbols but with different linkage.

What needs to be done?
Add a usage file which can work without the wrapper, i.e. using

    target_link_libraries(main PRIVATE $<IF:$<TARGET_EXISTS:flecs::flecs>,flecs::flecs,flecs::flecs_static>)

Originally posted by @dg0yt in #31432 (comment)

@MonicaLiu0311 MonicaLiu0311 added the category:port-bug The issue is with a library, which is something the port should already support label May 18, 2023
@myd7349
Copy link
Contributor

myd7349 commented May 18, 2023

This issue is not unique to flecs.

There are many C++ libraries, such as zeromq and xeus, that have CMake support for building both dynamic and static libraries at the same time. In such cases, the library maintainers differentiate between the targets for dynamic and static libraries (usually including "static" in the target name for the static library).

Based on my vague recollection, in the past few years, when encountering such libraries, vcpkg recommended adding a vcpkg-cmake-wrapper.cmake to link the static target and dynamic target together.

I remember that this approach was mentioned either in the vcpkg documentation or in responses from core members of the vcpkg team in related issues. However, I am currently unable to locate the exact source.

OK. I think I find it.

#6045 (comment)

If I have misunderstood, please correct me.

@dg0yt
Copy link
Contributor Author

dg0yt commented May 18, 2023

@myd7349 This issue is about a particular bad output from vcpkg tool's usage heuristics which can be fixed by a usage file. My post ist clear about it.

(Wrapper are only loosely related to the issue. I wouldn't add one for this port. But I didn't ask to remove it, and I protested against breaking users by removing it.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants