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

Namespaced includes #626

Merged
merged 8 commits into from
Apr 23, 2023

Conversation

vkrause
Copy link
Member

@vkrause vkrause commented Mar 1, 2023

This is the alternative approach to #625, and is source-compatible for CMake consumers.

This still needs to be checked for completeness (ie. are all headers really working in a pure namespaced use now), and needs the opt-out switch in the CMake config files, but it should hopefully be sufficient to decide on which of the approaches to take.

@vkrause vkrause changed the title Draft: Namespaced includes Namespaced includes Mar 2, 2023
@vkrause
Copy link
Member Author

vkrause commented Mar 2, 2023

Tested by including all headers in the namespaced form in consumer code and building with the namespace folder removed from the search path. Also verified that an unmodified Neochat still builds fine after this.

@vkrause
Copy link
Member Author

vkrause commented Mar 13, 2023

@KitsuneRal so how should we proceed with this?

@KitsuneRal
Copy link
Member

Upon a quick glance, I certainly like this approach over #625. I will take a closer look at it next week.

@KitsuneRal KitsuneRal added enhancement A feature or change request for the library building/packaging Issues with CMake files or packaging labels Mar 16, 2023
@vkrause
Copy link
Member Author

vkrause commented Apr 10, 2023

Upon a quick glance, I certainly like this approach over #625. I will take a closer look at it next week.

Any news on this?

@KitsuneRal
Copy link
Member

KitsuneRal commented Apr 22, 2023

I tested it out with Quaternion and it actually looks quite good. Can you please resolve the conflicts (I think the only actual one is in CMakeLists.txt), and I will merge it.

Copy link
Member

@KitsuneRal KitsuneRal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I actually have one suggestion, but I'm fine to merge this PR without applying it, and implement that suggestion on my end as a separate PR instead.

CMakeLists.txt Outdated Show resolved Hide resolved
The include search path propagated by CMake to consumers is adjusted
accordingly, so this remains source-compatible.
For this to work transparently, add the include install location to the
search path as well.
Setting QUOTIENT_FORCE_NAMESPACED_INCLUDES before the find_package
call will not add the namespace include dir to the search path.

This isn't really elegant, but allows both retaining full source
compatibility and helps consumers that have clashing include file
names.
@vkrause vkrause force-pushed the work/vkrause/namespaced-includes branch from 32180f3 to 69aa818 Compare April 23, 2023 10:00
This is necessary in order to also allow enforcing namespaced includes
in embedded/inline builds of libQuotient and is cleaner to do that way
then to manually mess with include search paths just for the tests.
@KitsuneRal KitsuneRal merged commit 4055bc6 into quotient-im:dev Apr 23, 2023
@KitsuneRal KitsuneRal linked an issue May 22, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
building/packaging Issues with CMake files or packaging enhancement A feature or change request for the library
Projects
Status: Version 0.7 - Done
Development

Successfully merging this pull request may close these issues.

Move headers to dedicated libquotient directory
2 participants