Skip to content

Commit b6b58d9

Browse files
committed
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.
1 parent a7f4cf9 commit b6b58d9

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

build-cross-tools.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ while [ $# -gt 0 ]; do
3131
--disable-clang-tools-extra)
3232
LLVM_ARGS="$LLVM_ARGS $1"
3333
;;
34+
--no-llvm-tool-reuse)
35+
LLVM_ARGS="$LLVM_ARGS $1"
36+
;;
3437
--disable-mingw-w64-tools)
3538
NO_MINGW_W64_TOOLS=1
3639
;;

build-llvm.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ while [ $# -gt 0 ]; do
6565
--disable-clang-tools-extra)
6666
unset CLANG_TOOLS_EXTRA
6767
;;
68+
--no-llvm-tool-reuse)
69+
NO_LLVM_TOOL_REUSE=1
70+
;;
6871
*)
6972
PREFIX="$1"
7073
;;
@@ -186,7 +189,7 @@ if [ -n "$HOST" ]; then
186189
fi
187190

188191

189-
if [ -n "$native" ]; then
192+
if [ -n "$native" ] && [ -z "$NO_LLVM_TOOL_REUSE" ]; then
190193
CMAKEFLAGS="$CMAKEFLAGS -DLLVM_NATIVE_TOOL_DIR=$native"
191194
fi
192195
CROSS_ROOT=$(cd $(dirname $(command -v $HOST-gcc))/../$HOST && pwd)

0 commit comments

Comments
 (0)