[PATCH] D68429: [clang] [cmake] Use add_clang_tool() to install all tools

Michał Górny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 3 15:05:52 PDT 2019


mgorny created this revision.
mgorny added reviewers: compnerd, phosek, smeenai, beanz, tstellar.

Switch clang-check, clang-extdef-mapping and clang-offload-bundler
to use add_clang_tool() rather than add_clang_executable() with a custom
install rule.  This makes them LLVM_DISTRIBUTION_COMPONENTS-friendly.


https://reviews.llvm.org/D68429

Files:
  clang/tools/clang-check/CMakeLists.txt
  clang/tools/clang-extdef-mapping/CMakeLists.txt
  clang/tools/clang-offload-bundler/CMakeLists.txt


Index: clang/tools/clang-offload-bundler/CMakeLists.txt
===================================================================
--- clang/tools/clang-offload-bundler/CMakeLists.txt
+++ clang/tools/clang-offload-bundler/CMakeLists.txt
@@ -4,7 +4,7 @@
   set(tablegen_deps intrinsics_gen)
 endif()
 
-add_clang_executable(clang-offload-bundler
+add_clang_tool(clang-offload-bundler
   ClangOffloadBundler.cpp
   
   DEPENDS
@@ -21,5 +21,3 @@
   PRIVATE
   ${CLANG_OFFLOAD_BUNDLER_LIB_DEPS}
   )
-
-install(TARGETS clang-offload-bundler RUNTIME DESTINATION bin)
Index: clang/tools/clang-extdef-mapping/CMakeLists.txt
===================================================================
--- clang/tools/clang-extdef-mapping/CMakeLists.txt
+++ clang/tools/clang-extdef-mapping/CMakeLists.txt
@@ -3,7 +3,7 @@
   support
   )
 
-add_clang_executable(clang-extdef-mapping
+add_clang_tool(clang-extdef-mapping
   ClangExtDefMapGen.cpp
   )
 
@@ -16,6 +16,3 @@
   clangSerialization
   clangTooling
   )
-
-install(TARGETS clang-extdef-mapping
-  RUNTIME DESTINATION bin)
Index: clang/tools/clang-check/CMakeLists.txt
===================================================================
--- clang/tools/clang-check/CMakeLists.txt
+++ clang/tools/clang-check/CMakeLists.txt
@@ -4,7 +4,7 @@
   Support
   )
 
-add_clang_executable(clang-check
+add_clang_tool(clang-check
   ClangCheck.cpp
   )
 
@@ -19,6 +19,3 @@
   clangStaticAnalyzerFrontend
   clangTooling
   )
-
-install(TARGETS clang-check
-  RUNTIME DESTINATION bin)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68429.223108.patch
Type: text/x-patch
Size: 1507 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191003/a800f6ba/attachment.bin>


More information about the cfe-commits mailing list