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
Handling loose object files #5159
Comments
Hi, thanks for raising the issue. |
I'm not 100% certain, the library is a third-party proprietary library for which I only have binaries, however, I believe they do some pre-main shenanigans. The only way to really force pre-main functions to be included into an executable or library is to link in an object file. Technically, you could archive the object, then link it in as static library with Regarding In practice, I've only rarely seen interface sources in cmake, and they have exclusively been either header files (which don't actually need to be compiled) or object files (which are already compiled, and so just need to be linked in). They aren't used or intended to be used as a way to ship source code, but rather to handle weird edge-cases (like pre-main functions). |
I have run into this issue. Again, similarly using a commercial library which requires linking to object files. I had to settle and specify as sources in my cmake file. |
maybe a half fix could be allowing arbitrary info in cpp_info which you can then reference in cmake. It would require a manual step in your cmake still, but at least most of the info would still be handled in the package. |
I think maybe you can use user_info for that...gonna try. |
|
I have an interesting package that I'm not quite sure how to handle.
In essence it consists of an object file
foo.o
and static librarieslibX.a
andlibY.a
, and to use the package you need in your link linefoo.o libX.a libY.a
in that precise order. As far as I can tell there is no real way to specify this information to conan, here is what I've tried:INTERFACE_LINK_OPTIONS
the order is reversed, see here for cmake's default link line). In any case, I don't think there should be any guarantees of whether the linkflags or libs come first in the link line.For now I've hacked around this by just setting
sharedlinkflags
and notexelinkflags
, but this seems potentially brittle with other generators (which I'm not as familiar with, mainly have just used them for various third party libraries). Fundamentally, I think there should be something like acommonlinkflags
or justlinkflags
that are needed by both shared libraries and executables.More specific to my problem, it seems like I'm looking for something along the lines of cmake's interface sources, so ideally I would have something like the following
I don't know what generators could really use this info other than cmake, but it's not like everything is used by every generator (e.g.
env_info
is not exposed in the cmake generator).The text was updated successfully, but these errors were encountered: