ppsspp/b.sh

76 lines
1.6 KiB
Bash
Raw Normal View History

#!/bin/bash
2014-07-24 06:34:46 +00:00
CMAKE=1
# Check arguments
while test $# -gt 0
do
case "$1" in
2014-07-24 06:34:46 +00:00
--qt) echo "Qt enabled"
CMAKE=0
;;
2016-10-14 21:15:16 +00:00
--ios) CMAKE_ARGS="-DCMAKE_TOOLCHAIN_FILE=cmake/Toolchains/ios.cmake ${CMAKE_ARGS}"
2014-07-24 06:34:46 +00:00
TARGET_OS=iOS
;;
--android) CMAKE_ARGS="-DCMAKE_TOOLCHAIN_FILE=android/android.toolchain.cmake ${CMAKE_ARGS}"
TARGET_OS=Android
PACKAGE=1
;;
2014-07-24 06:34:46 +00:00
--simulator) echo "Simulator mode enabled"
CMAKE_ARGS="-DSIMULATOR=ON ${CMAKE_ARGS}"
;;
--release)
CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Release ${CMAKE_ARGS}"
QMAKE_ARGS="CONFIG+=release ${QMAKE_ARGS}"
2014-07-24 06:34:46 +00:00
;;
--debug)
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}"
;;
2015-04-03 21:50:51 +00:00
--unittest) echo "Build unittest"
CMAKE_ARGS="-DUNITTEST=ON ${CMAKE_ARGS}"
;;
2014-07-24 06:34:46 +00:00
--no-package) echo "Packaging disabled"
PACKAGE=0
;;
--*) 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")"
2013-11-28 14:23:47 +00:00
else
echo "Building for native host."
if [ "$CMAKE" == "0" ]; then
BUILD_DIR="build-qt"
else
BUILD_DIR="build"
fi
2013-11-28 14:23:47 +00:00
fi
# 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
make -j4 $MAKE_OPT
popd