cmake: Define zephyr_generated_headers as an interface library
Define `zephyr_generated_headers` as an interface library rather than a
custom target. This allows CMake libraries to depend on this target
AND propagate the dependency if needed using target_link_libraries.
Example:
If some user header includes offsets.h, even transitively, then
offsets.h must be generated before any source file that includes that
header is compiled. This can be captured by defining a library `foo` for
the header with a public link dependency on zephyr_generated_headers
using `target_link_libraries(foo zephyr_generated_headers)`. The
ordering dependency on the generated offsets.h header will then
propagate to `foo` and any libraries that link against `foo`, even
transitively. This was not possible before this CL because one cannot
use custom targets as public link dependencies with
target_link_libraries.
Signed-off-by:
Kesavan Yogeswaran <hikes@google.com>
Loading
Please sign in to comment