This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Add clang-tidy headers to clang distribution
ClosedPublic

Authored by DmitryPolukhin on Jan 22 2020, 3:13 PM.
Tokens
"Like" token, awarded by SuibianP.

Details

Summary

Clang releases include static libraries for clang-tidy but corresponding
headers are missing in the tarball so these libraries are almost useless.
Clang-tidy libraries can be useful for build custom clang-tidy with
custom checks outside of llvm repo.

List of clang-tidy libraries included in clang 9.0.1 release:

lib/libclangTidyMPIModule.a
lib/libclangTidyPlugin.a
lib/libclangTidyBoostModule.a
lib/libclangTidyCERTModule.a
lib/libclangTidyAndroidModule.a
lib/libclangTidyPortabilityModule.a
lib/libclangTidyPerformanceModule.a
lib/libclangTidyOpenMPModule.a
lib/libclangTidyBugproneModule.a
lib/libclangTidyZirconModule.a
lib/libclangTidyCppCoreGuidelinesModule.a
lib/libclangTidyGoogleModule.a
lib/libclangTidyUtils.a
lib/libclangTidyHICPPModule.a
lib/libclangTidyModernizeModule.a
lib/libclangTidyLLVMModule.a
lib/libclangTidyAbseilModule.a
lib/libclangTidyReadabilityModule.a
lib/libclangTidyFuchsiaModule.a
lib/libclangTidyMiscModule.a
lib/libclangTidy.a
lib/libclangTidyObjCModule.a

Diff Detail

Event Timeline

DmitryPolukhin created this revision.Jan 22 2020, 3:13 PM
Herald added a project: Restricted Project. · View Herald Transcript

Can you upload the patch with context (git diff -U9999 if you're using the web interface or via arcanist)?

You'll want to add install targets for this, by adding a COMPONENT to the install command and referencing that in the target. See https://reviews.llvm.org/source/llvm-github/browse/master/clang/CMakeLists.txt;b4a99a061f517e60985667e39519f60186cbb469$438-446 for an example, though in your case the custom target doesn't need any dependencies.

clang-tools-extra/CMakeLists.txt
37 ↗(On Diff #239711)

Is it possible to set this to include/clang-tidy and then move the block into clang-tidy/CMakeLists.txt?

  • moved header installation to clang-tidy cmake file
  • added clang-tidy-header component

This LGTM, but I'll give the clang-tidy developers some time to weigh in.

clang-tools-extra/clang-tidy/CMakeLists.txt
106

You don't need the DEPENDS clang-headers

  • removed DEPENDS
DmitryPolukhin marked an inline comment as done.Jan 23 2020, 11:37 AM
alexfh accepted this revision.Jan 23 2020, 3:43 PM

LG with an outstanding comment.

clang-tools-extra/clang-tidy/CMakeLists.txt
104

Is this still relevant?

This revision is now accepted and ready to land.Jan 23 2020, 3:43 PM
DmitryPolukhin marked an inline comment as done.Jan 23 2020, 3:54 PM
DmitryPolukhin added inline comments.
clang-tools-extra/clang-tidy/CMakeLists.txt
104

Perhaps no, but I still see it in number of case. I'll remove it here.

remove PATTERN ".svn" EXCLUDE

This revision was automatically updated to reflect the committed changes.