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

Chore: Split public and internal headers #3880

Merged

Conversation

reneme
Copy link
Collaborator

@reneme reneme commented Jan 9, 2024

This is a follow-up for #3878 and causes a compilation error if we accidentally include an internal header in an example.

For that, I changed the layout of the header files linked into the build directory, like so:

# public headers (those are installed with the library)
./build/include/public/botan/*

# private headers (those are not installed and an application cannot use them)
./build/include/internal/botan/internal/*

# external headers that are installed with the library (used for PKCS#11 only)
./build/include/external/*

The build system templates can then selectively decide for each compilation unit which include paths are required. Practically, we always need all three types, except for the 'examples' which do not see the 'internal' headers anymore.

... so that the paths are defined in a single location. This does
not change the header file layout in the build folder, though.
This essentially hides the 'internal' headers from the code in the
'examples' build target. I.e. these files cannot use 'internal'
headers, just like any consuming application.
... making sure that only the necessary headers are visible to
any compilation unit.
@coveralls
Copy link

coveralls commented Jan 9, 2024

Coverage Status

coverage: 92.009% (-0.002%) from 92.011%
when pulling e036a7f on Rohde-Schwarz:chore/split_public_and_internal_headers
into fb4df9a on randombit:master.

@securitykernel
Copy link
Collaborator

LGTM. Maybe add a short one-liner explanation for the future you to configure.py on why we split up the include paths this way.

@reneme reneme merged commit 1e77255 into randombit:master Jan 10, 2024
36 of 37 checks passed
@reneme reneme deleted the chore/split_public_and_internal_headers branch January 10, 2024 09:52
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

Successfully merging this pull request may close these issues.

3 participants