[cmake] Update creation of object library dependencies for LINK_LIBS PUBLIC
authorStephen Neuendorffer <stephen.neuendorffer@xilinx.com>
Wed, 13 May 2020 03:43:50 +0000 (20:43 -0700)
committerStephen Neuendorffer <stephen.neuendorffer@xilinx.com>
Wed, 13 May 2020 05:36:52 +0000 (22:36 -0700)
commit085234bedc3803699e58a8c9e6bbace3388efee2
tree1c0d35f200c3e6ba1861f51eb2b0387e37bc822b
parent7d4167430c411ba1441260be9243d3401695ea7a
[cmake] Update creation of object library dependencies for LINK_LIBS PUBLIC

We need to avoid declaring dependencies on strings which are valid
LINK_LIBS and not valid targets.  Previously, we used if(TARGET) to
check this condition.  However, if(TARGET) checks whether a target has
been created (in the cmake subdirectory traversal order) and not
whether it *will* be created.  This results in annoying directory
ordering problems.

This patch changes the check to more explicitly eliminate problematic
libraries (namely -lpthread) using a REGEX.

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