On Fri, 30 Oct 2026 at 15:30, Peter Dimov <pdimov@gmail.com> wrote:
There are also downsides. If you add a header, but forget to add it to the CMakeLists.txt file (not an uncommon occurrence), everything will appear to work fine, but the header will not be installed.
This may go undetected for a long time if the test suite does not exercise every header (or does not test installation at all, also not an uncommon occurrence) and if the header is only needed rarely.
I agree. Bazel handles this by explicitly forbidding includes of unlisted files. We can't exactly do what Bazel does but we could get close by copying or symlinking the declared headers somewhere and only including from there. My instincts are telling me that's not a good idea, but it could be done.