diff --git a/build.sh b/build.sh index e65352edd2..d8efb61fd9 100755 --- a/build.sh +++ b/build.sh @@ -21,7 +21,7 @@ flags=(-DCMAKE_BUILD_PO=FALSE) cleanBuild=0 useClang=0 # 0 => no, 1 => yes, 2 => force yes -useCross=0 +useCross=2 for ARG in "$@"; do case "$ARG" in @@ -81,6 +81,13 @@ if [[ "$cleanBuild" -eq 1 ]]; then rm -fr $build/* fi +if [[ "$useCross" -eq 2 ]] && [[ "$(getconf LONG_BIT 2> /dev/null)" != 32 ]]; then + echo "Forcing cross compilation." + flags+=(-DCMAKE_TOOLCHAIN_FILE=cmake/linux-compiler-i386-multilib.cmake) +elif [[ "$useCross" -ne 1 ]]; then + useCross=0 +fi + echo "Building pcsx2 with ${flags[*]}" | tee $log # Resolve the symlink otherwise cmake is lost