build-llvm: Add an option --no-llvm-tool-reuse

This allows using the build-llvm.sh script for doing a cross build
of LLVM, while the same directory may contain a native build
which can be out of sync with the actual source.
This commit is contained in:
Martin Storsjö committed 2024-09-06 12:24:40 +03:00
1 parent a7f4cf9670
commit b6b58d96d9
2 files changed
+7 -1

No files matched your search

+3
View File
@@ -31,6 +31,9 @@ while [ $# -gt 0 ]; do
--disable-clang-tools-extra)
LLVM_ARGS="$LLVM_ARGS $1"
;;
--no-llvm-tool-reuse)
LLVM_ARGS="$LLVM_ARGS $1"
;;
--disable-mingw-w64-tools)
NO_MINGW_W64_TOOLS=1
;;
+4 -1
View File
@@ -65,6 +65,9 @@ while [ $# -gt 0 ]; do
--disable-clang-tools-extra)
unset CLANG_TOOLS_EXTRA
;;
--no-llvm-tool-reuse)
NO_LLVM_TOOL_REUSE=1
;;
*)
PREFIX="$1"
;;
@@ -186,7 +189,7 @@ if [ -n "$HOST" ]; then
fi
if [ -n "$native" ]; then
if [ -n "$native" ] && [ -z "$NO_LLVM_TOOL_REUSE" ]; then
CMAKEFLAGS="$CMAKEFLAGS -DLLVM_NATIVE_TOOL_DIR=$native"
fi
CROSS_ROOT=$(cd $(dirname $(command -v $HOST-gcc))/../$HOST && pwd)