Support cross compilation to non-windows targets
Don't have --host/$HOST imply targeting Windows, but actually inspect the target triple where necessary.
This commit is contained in:
1 parent
c49af4399a
commit
06f44cda62
4 files changed
+57
-24
No files matched your search
+13
-2
@@ -89,10 +89,21 @@ fi
|
||||
if [ -n "$HOST" ]; then
|
||||
BUILDDIR=$BUILDDIR-$HOST
|
||||
|
||||
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_SYSTEM_NAME=Windows"
|
||||
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_C_COMPILER=$HOST-gcc"
|
||||
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_CXX_COMPILER=$HOST-g++"
|
||||
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_RC_COMPILER=$HOST-windres"
|
||||
case $HOST in
|
||||
*-mingw32)
|
||||
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_SYSTEM_NAME=Windows"
|
||||
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_RC_COMPILER=$HOST-windres"
|
||||
;;
|
||||
*-linux*)
|
||||
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_SYSTEM_NAME=Linux"
|
||||
;;
|
||||
*)
|
||||
echo "Unrecognized host $HOST"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_FIND_ROOT_PATH=$LLVM_DIR"
|
||||
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER"
|
||||
|
||||
Reference in new issue
Block a user