[clang] 03559c6 - [diagtool] Install diagtool when LLVM_INSTALL_TOOLCHAIN_ONLY is ON.

Volodymyr Sapsai via cfe-commits cfe-commits at lists.llvm.org
Fri May 29 16:26:06 PDT 2020


Author: Volodymyr Sapsai
Date: 2020-05-29T16:25:06-07:00
New Revision: 03559c684a9bfe4de142fa4a7d2ef1edf08a8ad3

URL: https://github.com/llvm/llvm-project/commit/03559c684a9bfe4de142fa4a7d2ef1edf08a8ad3
DIFF: https://github.com/llvm/llvm-project/commit/03559c684a9bfe4de142fa4a7d2ef1edf08a8ad3.diff

LOG: [diagtool] Install diagtool when LLVM_INSTALL_TOOLCHAIN_ONLY is ON.

Not sure about other platforms but `install-xcode-toolchain` was already
including diagtool in the toolchain. This change makes it possible to
install diagtool during Apple's 2-stage build.

Instead of dropping `if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)` conditional
I've switched to `add_clang_tool` which handles install targets. Also a
few other clang tools like clang-format, clang-scan-deps are using this
macro, so it is good to be consistent.

rdar://problem/15386909

Reviewed By: JDevlieghere

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

Added: 
    

Modified: 
    clang/tools/diagtool/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/clang/tools/diagtool/CMakeLists.txt b/clang/tools/diagtool/CMakeLists.txt
index a95444be40ee..b49619c075c7 100644
--- a/clang/tools/diagtool/CMakeLists.txt
+++ b/clang/tools/diagtool/CMakeLists.txt
@@ -2,7 +2,7 @@ set(LLVM_LINK_COMPONENTS
   Support
   )
 
-add_clang_executable(diagtool
+add_clang_tool(diagtool
   diagtool_main.cpp
   DiagTool.cpp
   DiagnosticNames.cpp
@@ -17,15 +17,3 @@ clang_target_link_libraries(diagtool
   clangBasic
   clangFrontend
   )
-
-if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
-  install(TARGETS diagtool
-    COMPONENT diagtool
-    RUNTIME DESTINATION bin)
-
-  if (NOT LLVM_ENABLE_IDE)
-    add_llvm_install_targets(install-diagtool
-      DEPENDS diagtool
-      COMPONENT diagtool)
-  endif()
-endif()


        


More information about the cfe-commits mailing list