build-llvm: Use the built-in recursive cmake for building llvm-tblgen if necessary
This requires setting a flag to use the system default compiler for this, instead of the cross compiler.
This commit is contained in:
1 parent
a8829aeebb
commit
873243acc2
1 file changed
+7
-14
+7
-14
@@ -96,27 +96,20 @@ if [ -n "$HOST" ]; then
|
||||
echo $(dirname $(which llvm-tblgen))
|
||||
fi
|
||||
}
|
||||
native=$(find_native_tools)
|
||||
if [ -z "$native" ]; then
|
||||
# As we don't do any install here, the target prefix shouldn't actually
|
||||
# be created.
|
||||
HOST="" BUILDTARGETS="llvm-tblgen clang-tblgen llvm-config" $0 $PREFIX/llvmtools
|
||||
native=$(find_native_tools)
|
||||
if [ -z "$native" ]; then
|
||||
echo Unable to find the newly built llvm-tblgen
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_SYSTEM_NAME=Windows"
|
||||
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_CROSSCOMPILING=TRUE"
|
||||
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_C_COMPILER=$HOST-gcc"
|
||||
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_CXX_COMPILER=$HOST-g++"
|
||||
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_RC_COMPILER=$HOST-windres"
|
||||
CMAKEFLAGS="$CMAKEFLAGS -DCROSS_TOOLCHAIN_FLAGS_NATIVE="
|
||||
|
||||
CMAKEFLAGS="$CMAKEFLAGS -DLLVM_TABLEGEN=$native/llvm-tblgen"
|
||||
CMAKEFLAGS="$CMAKEFLAGS -DCLANG_TABLEGEN=$native/clang-tblgen"
|
||||
CMAKEFLAGS="$CMAKEFLAGS -DLLVM_CONFIG_PATH=$native/llvm-config"
|
||||
native=$(find_native_tools)
|
||||
if [ -n "$native" ]; then
|
||||
CMAKEFLAGS="$CMAKEFLAGS -DLLVM_TABLEGEN=$native/llvm-tblgen"
|
||||
CMAKEFLAGS="$CMAKEFLAGS -DCLANG_TABLEGEN=$native/clang-tblgen"
|
||||
CMAKEFLAGS="$CMAKEFLAGS -DLLVM_CONFIG_PATH=$native/llvm-config"
|
||||
fi
|
||||
CROSS_ROOT=$(cd $(dirname $(which $HOST-gcc))/../$HOST && pwd)
|
||||
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_FIND_ROOT_PATH=$CROSS_ROOT"
|
||||
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER"
|
||||
|
||||
Reference in new issue
Block a user