This is an archive of the discontinued LLVM Phabricator instance.

[cmake] Ensure that LINK_LIBS are dependencies for object library targets
ClosedPublic

Authored by stephenneuendorffer on May 1 2020, 9:30 AM.

Details

Summary

In MLIR, it is common for automatically generated headers to be included
in many places. To avoid tracking these dependencies explicitly in
cmake, they are treated as part of a library which 'owns' the generated
header. Users of the generated header link against the owning library.
However, object libraries don't actually 'link', so this dependence gets
lost. This patch adds an explicit dependence for these generated headers
when creating object library targets to ensure that generated headers
are appropriately generated

Diff Detail