forked from hrydgard/ppsspp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
b.sh
executable file
·66 lines (62 loc) · 1.74 KB
/
b.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/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"
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}"
else
echo "Building for native host."
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
if [ "$BB_PACKAGE" == "1" ]; then
cp ../Blackberry/bar-descriptor.xml .
blackberry-nativepackager -package PPSSPP.bar bar-descriptor.xml $DEBUG_ARGS
fi
popd