[cmake] Ensure that LINK_LIBS are dependencies for object library targets
authorStephen Neuendorffer <stephen.neuendorffer@xilinx.com>
Fri, 1 May 2020 00:16:59 +0000 (17:16 -0700)
committerStephen Neuendorffer <stephen.neuendorffer@xilinx.com>
Mon, 4 May 2020 15:45:53 +0000 (08:45 -0700)
commit8303b1f46af6c9838d3338479e5db2551daae248
treefcc569f76a5738a01a3b6df1665af349ee71f162
parentd28f69d923a675af696c058747d63213e71e0997
[cmake] Ensure that LINK_LIBS are dependencies for object library targets

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

Differential Revision: https://reviews.llvm.org/D79241
llvm/cmake/modules/AddLLVM.cmake