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

Headers installed without library prefix/decoration #241

Open
boris-kolpackov opened this issue Feb 7, 2022 · 5 comments
Open

Headers installed without library prefix/decoration #241

boris-kolpackov opened this issue Feb 7, 2022 · 5 comments

Comments

@boris-kolpackov
Copy link

We are trying to package ctre for build2 where, in order to allow multiple libraries to co-exist, we have rules a bit stricter than "install whatever you want anywhere you want under /usr/include". Specifically, we normally require the headers either to be decorated with the library name (or be the library name) or they must be installed into a subdirectory of /usr/include decorated with the library name (or be the library name). This way we can be reasonably sure that independent libraries won't overwrite each other's headers.

Looking at ctre, I see a few problems in this area:

  1. There is the unicode-db.hpp header and the unicode-db/ subdirectory. In fact, this looks like an external library bundled with ctre (@cor3ntin, perhaps it's this one https://github.com/cor3ntin/ext-unicode-db). If that's the case, would it make sense to unbundle it or at least make it possible to unbundle (e.g., by including upstream's headers as-is)? Alternatively, if unbundling is not a good idea, would it be possible to prefix the header/directory with ctre (you would probably also want to prefix the namespace)?

  2. Similarly, there is ctll.hpp and ctll/. I suppose we can let this one slide (at least it includes half of the library name) but it makes me wonder if this could/should be a separate library (author of issue Packaging of this lib has multiple issues #207 seems to think so).

Could someone clarify what's going on here and if there are any plans to address these issues?

@hanickadot
Copy link
Owner

Hi, you can easily take everything in single-header and place it with ctre/ prefix into /usr/include that's the intended usage anyway. The unicode-db was designed to be integrated with and used mostly by CTRE.

About unification of namespaces ... I would prefer ctre and ctll to be separated, I don't have an opionion about moving uni into ctre.

@boris-kolpackov
Copy link
Author

you can easily take everything in single-header and place it with ctre/ prefix into /usr/include that's the intended usage anyway

That could work (we wouldn't even need the ctre/ prefix if we drop unicode-db.hpp -- not sure why it's exposed in single-header/). Tests would be a problem, however: some of them include individual headers rather than <ctre.hpp>.

@hanickadot
Copy link
Owner

I will change the tests.

@hanickadot
Copy link
Owner

unicode-db.hpp is there in case you already included ctre.hpp you can include only unicode-db.hpp

@boris-kolpackov
Copy link
Author

Thanks for the offer to change the tests.

Regarding unicode-db.hpp in single-header/: if it is part of the official interface, then we still have the naming issue. Do you think it would be possible to rename it to ctre-unicode-db.hpp or some such?

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