This is an archive of the discontinued LLVM Phabricator instance.

[clang] Add build and install targets for clang libraries
ClosedPublic

Authored by smeenai on Feb 14 2019, 6:44 PM.

Details

Summary

This is modeled after the existing llvm-libraries target. It's a
convenient way to include all clang libraries in a distribution.

This differs slightly from the llvm-libraries target in that it adds any
library added via add_clang_library, whereas llvm-libraries only
includes targets added via add_llvm_library that didn't use the MODULE
or BUILDTREE_ONLY arguments. add_clang_library doesn't appear to have
any equivalents of those arguments, so the conditions don't apply.

Diff Detail

Repository
rC Clang

Event Timeline

smeenai created this revision.Feb 14 2019, 6:44 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 14 2019, 6:44 PM
Herald added a subscriber: mgorny. · View Herald Transcript
smeenai updated this revision to Diff 186957.Feb 14 2019, 6:45 PM

Fix condition

A couple of things I noticed while writing this patch:

  • clang guards its install target creation with CMAKE_CONFIGURATION_TYPES, whereas LLVM uses LLVM_ENABLE_IDE. Should clang be switched over to be consistent with LLVM?
  • I realize we create the install-clang-libraries-stripped target (courtesy of add_llvm_install_targets), but don't actually add any dependencies to it, so it's a no-op. llvm-libraries has this problem too. I was thinking of just making install-clang-libraries-stripped synonymous with install-clang-libraries, because a lot of these libraries will be static, and stripping them makes them unusable since it removes their symbol tables. The target name will be a lie, but the behavior seems more useful. What do you think?
phosek accepted this revision.Feb 14 2019, 7:24 PM

LGTM

This revision is now accepted and ready to land.Feb 14 2019, 7:24 PM
This revision was automatically updated to reflect the committed changes.