[clang-tidy] Add clang-tidy headers to clang distribution
authorDmitry Polukhin <dmitry.polukhin@gmail.com>
Thu, 23 Jan 2020 23:57:45 +0000 (15:57 -0800)
committerDmitry Polukhin <dmitry.polukhin@gmail.com>
Fri, 24 Jan 2020 00:29:08 +0000 (16:29 -0800)
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

Reviewers: smeenai, jdoerfert, alexfh, hokein, aaron.ballman

Subscribers: mgehre, mgorny, xazax.hun, cfe-commits

Tags: #clang-tools-extra, #clang

Differential Revision: https://reviews.llvm.org/D73236

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

index 6dadb27..20800cf 100644 (file)
@@ -94,3 +94,19 @@ set(ALL_CLANG_TIDY_CHECKS ${ALL_CLANG_TIDY_CHECKS} PARENT_SCOPE)
 add_subdirectory(plugin)
 add_subdirectory(tool)
 add_subdirectory(utils)
+
+if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
+  install(DIRECTORY .
+    DESTINATION include/clang-tidy
+    COMPONENT clang-tidy-headers
+    FILES_MATCHING
+    PATTERN "*.h"
+    )
+  add_custom_target(clang-tidy-headers)
+  set_target_properties(clang-tidy-headers PROPERTIES FOLDER "Misc")
+  if(NOT LLVM_ENABLE_IDE)
+    add_llvm_install_targets(install-clang-tidy-headers
+                             DEPENDS clang-tidy-headers
+                             COMPONENT clang-tidy-headers)
+  endif()
+endif()