This is an archive of the discontinued LLVM Phabricator instance.

[libc] Extend add_object rule to handle helper object libraries.
ClosedPublic

Authored by sivachandra on Mar 25 2020, 10:08 PM.

Details

Summary

The rule is now called add_object_library.

Diff Detail

Event Timeline

sivachandra created this revision.Mar 25 2020, 10:08 PM
abrachet accepted this revision.Mar 26 2020, 4:37 PM
abrachet added inline comments.
libc/cmake/modules/LLVMLibCRules.cmake
118

Nit: this could say requires SRCS to be specified.

238

Why not from add_entrypoint_object targets?

This revision is now accepted and ready to land.Mar 26 2020, 4:37 PM
sivachandra marked 2 inline comments as done.Mar 28 2020, 12:00 AM
sivachandra added inline comments.
libc/cmake/modules/LLVMLibCRules.cmake
238

Essentially to avoid inconsistency. Either we get object files from all of the entrypoint deps, or from none of them. We cannot get from all of them as CMake might not have seen some of them yet. In case of object library deps though, we are enforcing that they be visible. This is not really a big ask as object libraries are usually helper libraries for a bunch of related functions.

That said, if we move to CMake 3.15, the widely expanded generator support could allow us to simplify and improve the situation here.

This revision was automatically updated to reflect the committed changes.