build-llvm: Use the new LLVM_NATIVE_TOOL_DIR option for pointing out preexisting native tools

This allows setting one variable pointing at all tools, instead
of setting multiple individual options for all tools.
This commit is contained in:
Martin Storsjö committed 2023-01-29 01:13:48 +02:00
1 parent c49460aa86
commit 8536b740e3
1 file changed
+1 -18
+1 -18
View File
@@ -171,24 +171,7 @@ if [ -n "$HOST" ]; then
if [ -n "$native" ]; then
if [ -x "$native/llvm-tblgen$suffix" ]; then
CMAKEFLAGS="$CMAKEFLAGS -DLLVM_TABLEGEN=$native/llvm-tblgen$suffix"
fi
if [ -x "$native/clang-tblgen$suffix" ]; then
CMAKEFLAGS="$CMAKEFLAGS -DCLANG_TABLEGEN=$native/clang-tblgen$suffix"
fi
if [ -x "$native/lldb-tblgen$suffix" ]; then
CMAKEFLAGS="$CMAKEFLAGS -DLLDB_TABLEGEN=$native/lldb-tblgen$suffix"
fi
if [ -x "$native/llvm-config$suffix" ]; then
CMAKEFLAGS="$CMAKEFLAGS -DLLVM_CONFIG_PATH=$native/llvm-config$suffix"
fi
if [ -x "$native/clang-pseudo-gen$suffix" ]; then
CMAKEFLAGS="$CMAKEFLAGS -DCLANG_PSEUDO_GEN=$native/clang-pseudo-gen$suffix"
fi
if [ -x "$native/clang-tidy-confusable-chars-gen$suffix" ]; then
CMAKEFLAGS="$CMAKEFLAGS -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=$native/clang-tidy-confusable-chars-gen$suffix"
fi
CMAKEFLAGS="$CMAKEFLAGS -DLLVM_NATIVE_TOOL_DIR=$native"
fi
CROSS_ROOT=$(cd $(dirname $(command -v $HOST-gcc))/../$HOST && pwd)
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_FIND_ROOT_PATH=$CROSS_ROOT"