Files
cmake/Tests/RunCMake/VerifyHeaderSets/VerifyEmptyHeaderSets.cmake
Mickaël Germain d6ecae0600 VERIFY_*_HEADER_SETS: Create verification targets even when empty
Always create `<target>_verify_*_header_sets` targets and the aggregate
`all_verify_*_header_sets` utility targets when the corresponding
property is enabled, even when no matching headers exist.

When headers exist, an OBJECT library is created as before. When no
headers are found, a UTILITY target is created instead to avoid
warnings from tools like Xcode's libtool about empty static libraries.

Update documentation with `.. versionchanged:: 4.4` directives, update
tests, and add a release note.

Fixes: #27685
2026-03-17 20:42:00 -07:00

10 lines
383 B
CMake

enable_language(C)
# Target with VERIFY_INTERFACE_HEADER_SETS ON but no interface file sets
add_library(empty_iface STATIC lib.c)
set_property(TARGET empty_iface PROPERTY VERIFY_INTERFACE_HEADER_SETS ON)
# Target with VERIFY_PRIVATE_HEADER_SETS ON but no private file sets
add_library(empty_priv STATIC lib.c)
set_property(TARGET empty_priv PROPERTY VERIFY_PRIVATE_HEADER_SETS ON)