This is an archive of the discontinued LLVM Phabricator instance.

[cmake] Update creation of object library dependencies for LINK_LIBS PUBLIC
ClosedPublic

Authored by stephenneuendorffer on May 12 2020, 8:51 PM.

Details

Summary

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.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptMay 12 2020, 8:51 PM
mehdi_amini accepted this revision.May 12 2020, 9:44 PM
mehdi_amini added inline comments.
llvm/cmake/modules/AddLLVM.cmake
487

Probably anything that starts with - isn't intended to be a dependency...

This revision is now accepted and ready to land.May 12 2020, 9:44 PM
stephenneuendorffer marked an inline comment as done.
This revision was automatically updated to reflect the committed changes.