Skip to content
Commit 2aba39d8 authored by Kesavan Yogeswaran's avatar Kesavan Yogeswaran Committed by Fabio Baltieri
Browse files

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: default avatarKesavan Yogeswaran <hikes@google.com>
parent b6296584
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment