2013-12-08 13:17:45 +00:00
|
|
|
#!/bin/bash
|
2014-07-24 06:34:46 +00:00
|
|
|
CMAKE=1
|
2014-08-08 16:45:51 +00:00
|
|
|
MAKE_JOBS=4
|
2013-12-08 13:17:45 +00:00
|
|
|
# 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}"
|
2014-03-07 05:48:11 +00:00
|
|
|
DEBUG_ARGS="-devMode -debugToken ${QNX_CONFIGURATION}/../debugtoken.bar"
|
2014-07-24 06:34:46 +00:00
|
|
|
PACKAGE=1
|
|
|
|
TARGET_OS=Blackberry
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Check Symbian NDK
|
|
|
|
if [ ! -z "$EPOCROOT" ]; then
|
|
|
|
QMAKE_ARGS="-spec symbian-sbsv2"
|
|
|
|
CMAKE=0
|
|
|
|
PACKAGE=1
|
|
|
|
MAKE_OPT="release-gcce ${MAKE_OPT}"
|
|
|
|
TARGET_OS=Symbian
|
2013-12-08 13:17:45 +00:00
|
|
|
fi
|
2013-11-29 13:24:12 +00:00
|
|
|
|
2013-12-08 13:17:45 +00:00
|
|
|
# Check arguments
|
|
|
|
while test $# -gt 0
|
|
|
|
do
|
|
|
|
case "$1" in
|
2014-07-24 06:34:46 +00:00
|
|
|
--qt) echo "Qt enabled"
|
|
|
|
CMAKE=0
|
2013-12-08 13:17:45 +00:00
|
|
|
;;
|
|
|
|
--ios) CMAKE_ARGS="-DCMAKE_TOOLCHAIN_FILE=ios/ios.toolchain.cmake -GXcode ${CMAKE_ARGS}"
|
2014-07-24 06:34:46 +00:00
|
|
|
TARGET_OS=iOS
|
2014-07-24 13:20:09 +00:00
|
|
|
PACKAGE=1
|
2013-12-08 13:17:45 +00:00
|
|
|
;;
|
|
|
|
--android) CMAKE_ARGS="-DCMAKE_TOOLCHAIN_FILE=android/android.toolchain.cmake ${CMAKE_ARGS}"
|
2014-07-24 13:20:09 +00:00
|
|
|
TARGET_OS=Android
|
|
|
|
PACKAGE=1
|
2013-12-08 13:17:45 +00:00
|
|
|
;;
|
2014-07-24 06:34:46 +00:00
|
|
|
--simulator) echo "Simulator mode enabled"
|
|
|
|
CMAKE_ARGS="-DSIMULATOR=ON ${CMAKE_ARGS}"
|
|
|
|
;;
|
|
|
|
--release)
|
2014-08-05 06:59:57 +00:00
|
|
|
CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Release ${CMAKE_ARGS}"
|
|
|
|
QMAKE_ARGS="CONFIG+=release ${QMAKE_ARGS}"
|
2014-07-24 06:34:46 +00:00
|
|
|
;;
|
|
|
|
--debug)
|
2014-08-05 06:59:57 +00:00
|
|
|
CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Debug ${CMAKE_ARGS}"
|
|
|
|
QMAKE_ARGS="CONFIG+=debug ${QMAKE_ARGS}"
|
|
|
|
;;
|
|
|
|
--system-ffmpeg)
|
|
|
|
QMAKE_ARGS="CONFIG+=system_ffmpeg ${QMAKE_ARGS}"
|
2014-07-24 06:34:46 +00:00
|
|
|
;;
|
|
|
|
--headless) echo "Headless mode enabled"
|
|
|
|
CMAKE_ARGS="-DHEADLESS=ON ${CMAKE_ARGS}"
|
|
|
|
;;
|
|
|
|
--no-package) echo "Packaging disabled"
|
|
|
|
PACKAGE=0
|
2013-12-08 13:17:45 +00:00
|
|
|
;;
|
|
|
|
--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"
|
2013-12-08 13:17:45 +00:00
|
|
|
;;
|
|
|
|
--*) echo "Bad option: $1"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
*) MAKE_OPT="$1 ${MAKE_OPT}"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
2014-07-24 06:34:46 +00:00
|
|
|
if [ ! -z "$TARGET_OS" ]; then
|
|
|
|
echo "Building for $TARGET_OS"
|
|
|
|
BUILD_DIR="$(tr [A-Z] [a-z] <<< build-"$TARGET_OS")"
|
2014-08-08 16:45:51 +00:00
|
|
|
# HACK (doesn't like shadowed dir)
|
2014-07-24 06:34:46 +00:00
|
|
|
if [ "$TARGET_OS" == "Symbian" ]; then
|
|
|
|
BUILD_DIR="Qt"
|
2014-08-08 16:45:51 +00:00
|
|
|
# Temporarily limiting memory usage for automated builds.
|
|
|
|
MAKE_JOBS=2
|
2014-07-24 06:34:46 +00:00
|
|
|
fi
|
2013-11-28 14:23:47 +00:00
|
|
|
else
|
2013-12-08 13:17:45 +00:00
|
|
|
echo "Building for native host."
|
2014-08-05 07:54:39 +00:00
|
|
|
if [ "$CMAKE" == "0" ]; then
|
|
|
|
BUILD_DIR="build-qt"
|
|
|
|
else
|
|
|
|
BUILD_DIR="build"
|
|
|
|
fi
|
2013-11-28 14:23:47 +00:00
|
|
|
fi
|
2013-12-08 13:17:45 +00:00
|
|
|
|
|
|
|
# Strict errors. Any non-zero return exits this script
|
|
|
|
set -e
|
|
|
|
|
2014-07-24 06:34:46 +00:00
|
|
|
mkdir -p ${BUILD_DIR}
|
|
|
|
pushd ${BUILD_DIR}
|
|
|
|
|
|
|
|
if [ "$CMAKE" == "1" ]; then
|
|
|
|
cmake $HEADLESS $CMAKE_ARGS .. | (grep -v "^-- " || true)
|
|
|
|
else
|
|
|
|
qmake $QMAKE_ARGS ../Qt/PPSSPPQt.pro
|
|
|
|
fi
|
|
|
|
|
2014-08-08 16:45:51 +00:00
|
|
|
make -j$MAKE_JOBS $MAKE_OPT
|
2014-07-24 06:34:46 +00:00
|
|
|
|
|
|
|
if [ "$PACKAGE" == "1" ]; then
|
2014-07-24 07:02:15 +00:00
|
|
|
if [ "$TARGET_OS" == "Blackberry" ]; then
|
2014-07-24 06:34:46 +00:00
|
|
|
cp ../Blackberry/bar-descriptor.xml .
|
|
|
|
blackberry-nativepackager -package PPSSPP.bar bar-descriptor.xml $DEBUG_ARGS
|
2014-07-24 07:02:15 +00:00
|
|
|
elif [ "$TARGET_OS" == "Symbian" ]; then
|
2014-07-24 06:34:46 +00:00
|
|
|
make sis
|
2014-07-24 07:02:15 +00:00
|
|
|
elif [ "$TARGET_OS" == "iOS" ]; then
|
|
|
|
xcodebuild -configuration Release
|
2014-07-24 06:34:46 +00:00
|
|
|
fi
|
2013-12-08 13:17:45 +00:00
|
|
|
fi
|
2013-11-28 15:34:56 +00:00
|
|
|
popd
|