Add target to verify that all headers in header sets can be compiled independently
Users may want to verify that all headers in a target's header sets can be compiled independently of other headers, and that including them by their intended path works.
To that end, we will create a new VERIFY_HEADER_SETS
target property, initialized by a CMAKE_VERIFY_HEADER_SETS
variable. If this property is set, an object library called <target>_verify_header_sets
will be created, which links against the target. This new verification target is EXCLUDE_FROM_ALL
and has autogen and unity builds disabled. The verification target compiles a series of files named <target>_verify_header_sets/<path to header>.(c|cxx)
, where one such file exists for each file in the target's PUBLIC
and INTERFACE
header sets. Each file contains only #include <path to header>
. They are compiled as C or C++ depending on the LANGUAGE
property of the header file.