This is an archive of the discontinued LLVM Phabricator instance.

[cmake] Add missing dependencies to objlib in add_llvm_executable.
ClosedPublic

Authored by fhahn on Jun 8 2022, 9:14 AM.

Details

Summary

After f06abbb393800b0d466c88e283c06f75561c432c I have been seeing build
failures due to the obj.clang target missing a dependency on
tools/clang/clang-tablegen-targets.

This appears to be due to the fact that LLVM_COMMON_DEPENDS are not added
as dependencies to the object library.

This patch uses the same logic as llvm_add_library to register
dependencies for object libraries.

Diff Detail

Event Timeline

fhahn created this revision.Jun 8 2022, 9:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 8 2022, 9:14 AM
fhahn requested review of this revision.Jun 8 2022, 9:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 8 2022, 9:14 AM
abrachet accepted this revision.Jun 8 2022, 9:23 AM
This revision is now accepted and ready to land.Jun 8 2022, 9:23 AM
beanz accepted this revision.Jun 8 2022, 9:29 AM

LGTM, one comment.

llvm/cmake/modules/AddLLVM.cmake
972

Unless I'm misunderstanding the behavior issues you're seeing here are a bug in our code not CMake. IIUC, the issue you're seeing is that since the objlib doesn't depend on the tablegen targets, it is likely failing to build or building out of order. That's clearly a bug in our code, not CMake.

I know that you copied that comment, but it doesn't seem relevant here, and I think it is describing a situation that isn't actually a bug in CMake.

This revision was landed with ongoing or failed builds.Jun 9 2022, 1:24 AM
This revision was automatically updated to reflect the committed changes.
fhahn marked an inline comment as done.
fhahn added inline comments.Jun 9 2022, 1:24 AM
llvm/cmake/modules/AddLLVM.cmake
972

Thanks, I agree that the comment here is a bit out of place. I've removed it in the committed version.