[PATCH] D81447: [llvm] Added support for stand-alone cmake object libraries.

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 8 22:05:05 PDT 2020


mtrofin created this revision.
mtrofin added reviewers: karies, davidxl.
Herald added subscribers: llvm-commits, hiraditya, mgorny.
Herald added a project: LLVM.
MaskRay added reviewers: beanz, phosek, smeenai.

Currently, add_llvm_library would create an OBJECT library alongside
of a STATIC / SHARED library, but losing the link interface (its
elements would become dependencies instead). To support scenarios
where linking an object library also brings in its usage
requirements, this patch adds support for 'stand-alone' OBJECT
libraries - i.e. without an accompanying SHARED/STATIC library, and
maintaining the link interface defined by the user.

This is useful for cases where, for example, we want to build a part
of a component separately. Using a STATIC target would incur the risk
that symbols not referenced in the consumer would be dropped (which may
be undesirable).

The current application is the ML part of Analysis. It should be part
of the Analysis component, so it may reference other analyses; and (in
upcoming changes) it has dependencies on optional libraries.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81447

Files:
  llvm/cmake/modules/AddLLVM.cmake
  llvm/lib/Analysis/CMakeLists.txt
  llvm/lib/Analysis/LLVMBuild.txt
  llvm/lib/Analysis/ML/CMakeLists.txt
  llvm/lib/Analysis/ML/LLVMBuild.txt
  llvm/lib/Passes/LLVMBuild.txt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81447.269414.patch
Type: text/x-patch
Size: 6044 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200609/36892fbb/attachment.bin>


More information about the llvm-commits mailing list