Skip to content

Commit 5ae5b1a

Browse files
committed
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.
1 parent 0dbd9ba commit 5ae5b1a

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

build-llvm.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ BUILDDIR="build"
2323
LINK_DYLIB=ON
2424
ASSERTSSUFFIX=""
2525
LLDB=ON
26+
CLANG_TOOLS_EXTRA=ON
2627

2728
while [ $# -gt 0 ]; do
2829
case "$1" in
@@ -64,6 +65,9 @@ while [ $# -gt 0 ]; do
6465
--disable-lldb)
6566
unset LLDB
6667
;;
68+
--disable-clang-tools-extra)
69+
unset CLANG_TOOLS_EXTRA
70+
;;
6771
*)
6872
PREFIX="$1"
6973
;;
@@ -73,7 +77,7 @@ done
7377
BUILDDIR="$BUILDDIR$ASSERTSSUFFIX"
7478
if [ -z "$CHECKOUT_ONLY" ]; then
7579
if [ -z "$PREFIX" ]; then
76-
echo $0 [--enable-asserts] [--stage2] [--thinlto] [--lto] [--disable-dylib] [--full-llvm] [--with-python] [--symlink-projects] [--disable-lldb] [--host=triple] dest
80+
echo $0 [--enable-asserts] [--stage2] [--thinlto] [--lto] [--disable-dylib] [--full-llvm] [--with-python] [--symlink-projects] [--disable-lldb] [--disable-clang-tools-extra] [--host=triple] dest
7781
exit 1
7882
fi
7983

@@ -246,12 +250,22 @@ if [ -n "$SYMLINK_PROJECTS" ]; then
246250
fi
247251
done
248252
cd ..
253+
if [ -n "$CLANG_TOOLS_EXTRA" ]; then
254+
cd ../clang/tools
255+
if [ ! -e extra ]; then
256+
ln -s ../../clang-tools-extra extra
257+
fi
258+
cd ../../llvm
259+
fi
249260
else
250261
EXPLICIT_PROJECTS=1
251262
PROJECTS="clang;lld"
252263
if [ -n "$LLDB" ]; then
253264
PROJECTS="$PROJECTS;lldb"
254265
fi
266+
if [ -n "$CLANG_TOOLS_EXTRA" ]; then
267+
PROJECTS="$PROJECTS;clang-tools-extra"
268+
fi
255269
fi
256270

257271
[ -z "$CLEAN" ] || rm -rf $BUILDDIR

strip-llvm.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ MINGW*)
5252
esac
5353

5454
cd bin
55-
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
55+
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
5656
basename=$i
5757
if [ -n "$EXEEXT" ]; then
5858
# 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
6868
;;
6969
clang++|clang-*.*|clang-cpp)
7070
;;
71+
clangd)
72+
;;
73+
clang-tidy)
74+
;;
7175
clang-*)
7276
suffix="${basename#*-}"
7377
# Test removing all numbers from the suffix; if it is empty, the suffix

0 commit comments

Comments
 (0)