ppsspp/b.sh

67 lines
1.7 KiB
Bash
Raw Normal View History

#!/bin/bash
# Check Blackberry NDK
BB_OS=`cat ${QNX_TARGET}/etc/qversion 2>/dev/null`
if [ ! -z "$BB_OS" ]; then
CMAKE_ARGS="-DCMAKE_TOOLCHAIN_FILE=Blackberry/bb.toolchain.cmake -DBLACKBERRY=${BB_OS} ${CMAKE_ARGS}"
BUILD_EXT="-bb"
DEBUG_ARGS="-devMode -debugToken ${HOME}/debugtoken.bar"
BB_PACKAGE=1
fi
# Check arguments
while test $# -gt 0
do
case "$1" in
--headless) echo "Headless mode enabled"
CMAKE_ARGS="-DHEADLESS=ON ${CMAKE_ARGS}"
;;
--ios) CMAKE_ARGS="-DCMAKE_TOOLCHAIN_FILE=ios/ios.toolchain.cmake -GXcode ${CMAKE_ARGS}"
BUILD_EXT="-ios"
;;
--android) CMAKE_ARGS="-DCMAKE_TOOLCHAIN_FILE=android/android.toolchain.cmake ${CMAKE_ARGS}"
BUILD_EXT="-android"
;;
--no-package) echo "Blackberry packaging disabled"
BB_PACKAGE=0
;;
--release-package) echo "Blackberry release package enabled"
2013-12-09 04:42:49 +00:00
if [ ! -f "Blackberry/build.txt" ]; then
echo "1" > "Blackberry/build.txt"
fi
DEBUG_ARGS="-buildId ../Blackberry/build.txt"
;;
--simulator) echo "Simulator mode enabled"
CMAKE_ARGS="-DSIMULATOR=ON ${CMAKE_ARGS}"
;;
--*) echo "Bad option: $1"
exit 1
;;
*) MAKE_OPT="$1 ${MAKE_OPT}"
;;
esac
shift
done
if [ "$BUILD_EXT" == "-ios" ]; then
echo "Building for iOS"
elif [ "$BUILD_EXT" == "-android" ]; then
echo "Building for Android"
elif [ "$BUILD_EXT" == "-bb" ]; then
echo "Building for Blackberry ${BB_OS}"
2013-11-28 14:23:47 +00:00
else
echo "Building for native host."
2013-11-28 14:23:47 +00:00
fi
# Strict errors. Any non-zero return exits this script
set -e
mkdir -p build${BUILD_EXT}
pushd build${BUILD_EXT}
cmake $HEADLESS $CMAKE_ARGS .. | (grep -v "^-- " || true)
make -j4 $MAKE_OPT
2013-12-09 04:42:49 +00:00
if [ "$BB_PACKAGE" == "1" ]; then
cp ../Blackberry/bar-descriptor.xml .
blackberry-nativepackager -package PPSSPP.bar bar-descriptor.xml $DEBUG_ARGS
fi
popd