From d5d30fae23d39645dbfa5a75074648649643f002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Thu, 15 Oct 2020 23:20:32 +0300 Subject: [PATCH] build-llvm: If cross compiling, look for llvm-tblgen with an exe suffix If cross compiling on MSYS, the native llvm-tblgen needs this suffix. --- build-llvm.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/build-llvm.sh b/build-llvm.sh index e5a1538..b0bcb0e 100755 --- a/build-llvm.sh +++ b/build-llvm.sh @@ -109,10 +109,14 @@ if [ -n "$HOST" ]; then native=$(find_native_tools) if [ -n "$native" ]; then - CMAKEFLAGS="$CMAKEFLAGS -DLLVM_TABLEGEN=$native/llvm-tblgen" - CMAKEFLAGS="$CMAKEFLAGS -DCLANG_TABLEGEN=$native/clang-tblgen" - CMAKEFLAGS="$CMAKEFLAGS -DLLDB_TABLEGEN=$native/lldb-tblgen" - CMAKEFLAGS="$CMAKEFLAGS -DLLVM_CONFIG_PATH=$native/llvm-config" + suffix="" + if [ -f $native/llvm-tblgen.exe ]; then + suffix=".exe" + fi + CMAKEFLAGS="$CMAKEFLAGS -DLLVM_TABLEGEN=$native/llvm-tblgen$suffix" + CMAKEFLAGS="$CMAKEFLAGS -DCLANG_TABLEGEN=$native/clang-tblgen$suffix" + CMAKEFLAGS="$CMAKEFLAGS -DLLDB_TABLEGEN=$native/lldb-tblgen$suffix" + CMAKEFLAGS="$CMAKEFLAGS -DLLVM_CONFIG_PATH=$native/llvm-config$suffix" fi CROSS_ROOT=$(cd $(dirname $(which $HOST-gcc))/../$HOST && pwd) CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_FIND_ROOT_PATH=$CROSS_ROOT"