build-llvm: Build clang-tools-extra
This installs a bunch of new tools in the bin dir, namely the following: clang-apply-replacements clang-change-namespace clang-doc clang-include-fixer clang-move clang-query clang-reorder-fields clang-tidy clangd find-all-symbols modularize pp-trace run-clang-tidy These are stripped out by strip-llvm, but clangd and clang-tidy are kept.
This commit is contained in:
1 parent
0dbd9baba3
commit
5ae5b1aa37
2 files changed
+20
-2
No files matched your search
+15
-1
@@ -23,6 +23,7 @@ BUILDDIR="build"
|
|||||||
LINK_DYLIB=ON
|
LINK_DYLIB=ON
|
||||||
ASSERTSSUFFIX=""
|
ASSERTSSUFFIX=""
|
||||||
LLDB=ON
|
LLDB=ON
|
||||||
|
CLANG_TOOLS_EXTRA=ON
|
||||||
|
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@@ -64,6 +65,9 @@ while [ $# -gt 0 ]; do
|
|||||||
--disable-lldb)
|
--disable-lldb)
|
||||||
unset LLDB
|
unset LLDB
|
||||||
;;
|
;;
|
||||||
|
--disable-clang-tools-extra)
|
||||||
|
unset CLANG_TOOLS_EXTRA
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
PREFIX="$1"
|
PREFIX="$1"
|
||||||
;;
|
;;
|
||||||
@@ -73,7 +77,7 @@ done
|
|||||||
BUILDDIR="$BUILDDIR$ASSERTSSUFFIX"
|
BUILDDIR="$BUILDDIR$ASSERTSSUFFIX"
|
||||||
if [ -z "$CHECKOUT_ONLY" ]; then
|
if [ -z "$CHECKOUT_ONLY" ]; then
|
||||||
if [ -z "$PREFIX" ]; then
|
if [ -z "$PREFIX" ]; then
|
||||||
echo $0 [--enable-asserts] [--stage2] [--thinlto] [--lto] [--disable-dylib] [--full-llvm] [--with-python] [--symlink-projects] [--disable-lldb] [--host=triple] dest
|
echo $0 [--enable-asserts] [--stage2] [--thinlto] [--lto] [--disable-dylib] [--full-llvm] [--with-python] [--symlink-projects] [--disable-lldb] [--disable-clang-tools-extra] [--host=triple] dest
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -246,12 +250,22 @@ if [ -n "$SYMLINK_PROJECTS" ]; then
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
cd ..
|
cd ..
|
||||||
|
if [ -n "$CLANG_TOOLS_EXTRA" ]; then
|
||||||
|
cd ../clang/tools
|
||||||
|
if [ ! -e extra ]; then
|
||||||
|
ln -s ../../clang-tools-extra extra
|
||||||
|
fi
|
||||||
|
cd ../../llvm
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
EXPLICIT_PROJECTS=1
|
EXPLICIT_PROJECTS=1
|
||||||
PROJECTS="clang;lld"
|
PROJECTS="clang;lld"
|
||||||
if [ -n "$LLDB" ]; then
|
if [ -n "$LLDB" ]; then
|
||||||
PROJECTS="$PROJECTS;lldb"
|
PROJECTS="$PROJECTS;lldb"
|
||||||
fi
|
fi
|
||||||
|
if [ -n "$CLANG_TOOLS_EXTRA" ]; then
|
||||||
|
PROJECTS="$PROJECTS;clang-tools-extra"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -z "$CLEAN" ] || rm -rf $BUILDDIR
|
[ -z "$CLEAN" ] || rm -rf $BUILDDIR
|
||||||
|
|||||||
+5
-1
@@ -52,7 +52,7 @@ MINGW*)
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
cd bin
|
cd bin
|
||||||
for i in bugpoint c-index-test clang-* diagtool dsymutil git-clang-format hmaptool ld64.lld* llc lldb-* lli llvm-* obj2yaml opt sancov sanstats scan-build scan-view verify-uselistorder wasm-ld yaml2obj libclang.dll *LTO.dll *Remarks.dll *.bat; do
|
for i in bugpoint c-index-test clang-* clangd diagtool dsymutil find-all-symbols git-clang-format hmaptool ld64.lld* llc lldb-* lli llvm-* modularize obj2yaml opt pp-trace sancov sanstats scan-build scan-view verify-uselistorder wasm-ld yaml2obj libclang.dll *LTO.dll *Remarks.dll *.bat; do
|
||||||
basename=$i
|
basename=$i
|
||||||
if [ -n "$EXEEXT" ]; then
|
if [ -n "$EXEEXT" ]; then
|
||||||
# Some in the list are expanded globs, some are plain names we list.
|
# Some in the list are expanded globs, some are plain names we list.
|
||||||
@@ -68,6 +68,10 @@ for i in bugpoint c-index-test clang-* diagtool dsymutil git-clang-format hmapto
|
|||||||
;;
|
;;
|
||||||
clang++|clang-*.*|clang-cpp)
|
clang++|clang-*.*|clang-cpp)
|
||||||
;;
|
;;
|
||||||
|
clangd)
|
||||||
|
;;
|
||||||
|
clang-tidy)
|
||||||
|
;;
|
||||||
clang-*)
|
clang-*)
|
||||||
suffix="${basename#*-}"
|
suffix="${basename#*-}"
|
||||||
# Test removing all numbers from the suffix; if it is empty, the suffix
|
# Test removing all numbers from the suffix; if it is empty, the suffix
|
||||||
|
|||||||
Reference in new issue
Block a user