Skip to content

cmake: separate generated headers from translated headers#7263

Merged
ethomson merged 1 commit into
mainfrom
ethomson/build
May 16, 2026
Merged

cmake: separate generated headers from translated headers#7263
ethomson merged 1 commit into
mainfrom
ethomson/build

Conversation

@ethomson
Copy link
Copy Markdown
Member

Make a distinction between generated headers and "translated" headers. This is important to support build-time dependencies when headers are updated.

Generated headers are those which contain build-time feature specifications, like git2_features.h that are internal to the build and experimental.h that contain API information.

Translated headers are the headers that are in include/git2, but may be translated to have a unique prefix like incklude/git2-experimental.

This distinction is important so that the CMakeFiles.txt depend on the in-tree include files (src/include) and the generated header files but not the translated header files. Otherwise there are two pack.h and it's unclear whether the in-tree build is targeting the one in src/include or the one in the build tree.

Without this, updating an in-tree header file like pack.h would not cause a rebuild of its dependencies.

Make a distinction between generated headers and "translated" headers.
This is important to support build-time dependencies when headers are
updated.

Generated headers are those which contain build-time feature
specifications, like `git2_features.h` that are internal to the build
and `experimental.h` that contain API information.

Translated headers are the headers that are in `include/git2`, but may
be translated to have a unique prefix like `incklude/git2-experimental`.

This distinction is important so that the CMakeFiles.txt depend on the
in-tree include files (`src/include`) and the generated header files
_but not_ the translated header files. Otherwise there are two `pack.h`
and it's unclear whether the in-tree build is targeting the one in
`src/include` or the one in the build tree.

Without this, updating an in-tree header file like `pack.h` would not
cause a rebuild of its dependencies.
@ethomson ethomson merged commit b8e67d6 into main May 16, 2026
22 checks passed
@ethomson ethomson deleted the ethomson/build branch May 16, 2026 19:48
Copilot AI mentioned this pull request May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant