This is an archive of the discontinued LLVM Phabricator instance.

[cmake][NFC] Check for incorrect usage of LLVM components in LINK_LIBS
ClosedPublic

Authored by stephenneuendorffer on May 17 2020, 11:12 PM.

Details

Summary

Using LLVM components in LINK_LIBS means that the mechanisms for
replacing component dependencies with libLLVM.so break. Try to catch
this incorrect usage up front, instead of waiting until later when we
get difficult to understand runtime errors from incorrectly linked
libraries.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptMay 17 2020, 11:12 PM
stephenneuendorffer edited the summary of this revision. (Show Details)
mehdi_amini added inline comments.May 18 2020, 11:27 PM
mlir/cmake/modules/AddMLIR.cmake
113

Is the kind of things like LINK_COMPONENTS documented somewhere? I always end-up having to reverse engineer all this from the implementation, but I'll forget about the detail by the next time I have to do something significant there

stephenneuendorffer marked an inline comment as done.May 19 2020, 2:48 PM
stephenneuendorffer added inline comments.
mlir/cmake/modules/AddMLIR.cmake
113

https://mlir.llvm.org/docs/Tutorials/CreatingADialect/#cmake-best-practices-1
https://llvm.org/docs/Projects.html

The LLVM global documentation is woefully limited, but I haven't gotten motivated to wade into it.

This revision was not accepted when it landed; it landed in state Needs Review.May 19 2020, 2:55 PM
This revision was automatically updated to reflect the committed changes.