[diagtool] Install diagtool when LLVM_INSTALL_TOOLCHAIN_ONLY is ON.
authorVolodymyr Sapsai <vsapsai@apple.com>
Fri, 29 May 2020 00:06:33 +0000 (17:06 -0700)
committerVolodymyr Sapsai <vsapsai@apple.com>
Fri, 29 May 2020 23:25:06 +0000 (16:25 -0700)
commit03559c684a9bfe4de142fa4a7d2ef1edf08a8ad3
treee51e0160a37cb56350ed8beae0a3a22cbf6180b9
parent5a99ec10f5df7fa351e81b9bc90bf38e670653ae
[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
clang/tools/diagtool/CMakeLists.txt