Skip to content

Commit 0dbd9ba

Browse files
committed
build-llvm: Allow disabling building lldb
While lldb can be used as a cross debugger, it's probably mostly used when run on the same target as the code is executed on. Since it's a mostly optional component in the toolchain, allow passing --disable-lldb to build-llvm.sh to skip it.
1 parent b3f63b4 commit 0dbd9ba

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

build-llvm.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ unset HOST
2222
BUILDDIR="build"
2323
LINK_DYLIB=ON
2424
ASSERTSSUFFIX=""
25+
LLDB=ON
2526

2627
while [ $# -gt 0 ]; do
2728
case "$1" in
@@ -60,6 +61,9 @@ while [ $# -gt 0 ]; do
6061
--symlink-projects)
6162
SYMLINK_PROJECTS=1
6263
;;
64+
--disable-lldb)
65+
unset LLDB
66+
;;
6367
*)
6468
PREFIX="$1"
6569
;;
@@ -69,7 +73,7 @@ done
6973
BUILDDIR="$BUILDDIR$ASSERTSSUFFIX"
7074
if [ -z "$CHECKOUT_ONLY" ]; then
7175
if [ -z "$PREFIX" ]; then
72-
echo $0 [--enable-asserts] [--stage2] [--thinlto] [--lto] [--disable-dylib] [--full-llvm] [--with-python] [--symlink-projects] [--host=triple] dest
76+
echo $0 [--enable-asserts] [--stage2] [--thinlto] [--lto] [--disable-dylib] [--full-llvm] [--with-python] [--symlink-projects] [--disable-lldb] [--host=triple] dest
7377
exit 1
7478
fi
7579

@@ -234,13 +238,20 @@ if [ -n "$SYMLINK_PROJECTS" ]; then
234238
# checkouts.
235239
cd tools
236240
for p in clang lld lldb; do
241+
if [ "$p" = "lldb" ] && [ -z "$LLDB" ]; then
242+
continue
243+
fi
237244
if [ ! -e $p ]; then
238245
ln -s ../../$p .
239246
fi
240247
done
241248
cd ..
242249
else
243250
EXPLICIT_PROJECTS=1
251+
PROJECTS="clang;lld"
252+
if [ -n "$LLDB" ]; then
253+
PROJECTS="$PROJECTS;lldb"
254+
fi
244255
fi
245256

246257
[ -z "$CLEAN" ] || rm -rf $BUILDDIR
@@ -253,7 +264,7 @@ cmake \
253264
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
254265
-DCMAKE_BUILD_TYPE=Release \
255266
-DLLVM_ENABLE_ASSERTIONS=$ASSERTS \
256-
${EXPLICIT_PROJECTS+-DLLVM_ENABLE_PROJECTS="clang;lld;lldb"} \
267+
${EXPLICIT_PROJECTS+-DLLVM_ENABLE_PROJECTS="$PROJECTS"} \
257268
-DLLVM_TARGETS_TO_BUILD="ARM;AArch64;X86" \
258269
-DLLVM_INSTALL_TOOLCHAIN_ONLY=$TOOLCHAIN_ONLY \
259270
-DLLVM_LINK_LLVM_DYLIB=$LINK_DYLIB \

0 commit comments

Comments
 (0)