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.
This commit is contained in:
Martin Storsjö committed 2022-03-23 13:07:39 +02:00
1 parent b3f63b4ac8
commit 0dbd9baba3
1 file changed
+13 -2
+13 -2
View File
@@ -22,6 +22,7 @@ unset HOST
BUILDDIR="build" BUILDDIR="build"
LINK_DYLIB=ON LINK_DYLIB=ON
ASSERTSSUFFIX="" ASSERTSSUFFIX=""
LLDB=ON
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
case "$1" in case "$1" in
@@ -60,6 +61,9 @@ while [ $# -gt 0 ]; do
--symlink-projects) --symlink-projects)
SYMLINK_PROJECTS=1 SYMLINK_PROJECTS=1
;; ;;
--disable-lldb)
unset LLDB
;;
*) *)
PREFIX="$1" PREFIX="$1"
;; ;;
@@ -69,7 +73,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] [--host=triple] dest echo $0 [--enable-asserts] [--stage2] [--thinlto] [--lto] [--disable-dylib] [--full-llvm] [--with-python] [--symlink-projects] [--disable-lldb] [--host=triple] dest
exit 1 exit 1
fi fi
@@ -234,6 +238,9 @@ if [ -n "$SYMLINK_PROJECTS" ]; then
# checkouts. # checkouts.
cd tools cd tools
for p in clang lld lldb; do for p in clang lld lldb; do
if [ "$p" = "lldb" ] && [ -z "$LLDB" ]; then
continue
fi
if [ ! -e $p ]; then if [ ! -e $p ]; then
ln -s ../../$p . ln -s ../../$p .
fi fi
@@ -241,6 +248,10 @@ if [ -n "$SYMLINK_PROJECTS" ]; then
cd .. cd ..
else else
EXPLICIT_PROJECTS=1 EXPLICIT_PROJECTS=1
PROJECTS="clang;lld"
if [ -n "$LLDB" ]; then
PROJECTS="$PROJECTS;lldb"
fi
fi fi
[ -z "$CLEAN" ] || rm -rf $BUILDDIR [ -z "$CLEAN" ] || rm -rf $BUILDDIR
@@ -253,7 +264,7 @@ cmake \
-DCMAKE_INSTALL_PREFIX="$PREFIX" \ -DCMAKE_INSTALL_PREFIX="$PREFIX" \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_ASSERTIONS=$ASSERTS \ -DLLVM_ENABLE_ASSERTIONS=$ASSERTS \
${EXPLICIT_PROJECTS+-DLLVM_ENABLE_PROJECTS="clang;lld;lldb"} \ ${EXPLICIT_PROJECTS+-DLLVM_ENABLE_PROJECTS="$PROJECTS"} \
-DLLVM_TARGETS_TO_BUILD="ARM;AArch64;X86" \ -DLLVM_TARGETS_TO_BUILD="ARM;AArch64;X86" \
-DLLVM_INSTALL_TOOLCHAIN_ONLY=$TOOLCHAIN_ONLY \ -DLLVM_INSTALL_TOOLCHAIN_ONLY=$TOOLCHAIN_ONLY \
-DLLVM_LINK_LLVM_DYLIB=$LINK_DYLIB \ -DLLVM_LINK_LLVM_DYLIB=$LINK_DYLIB \