agb/mgba-test-runner/build-mgba.sh

48 lines
1.1 KiB
Bash
Raw Normal View History

2022-07-26 07:46:51 +10:00
#!/usr/bin/env bash
2021-07-04 02:33:15 +10:00
MGBA_VERSION=$1
OUT_DIRECTORY=$2
2021-07-04 07:18:34 +10:00
CURRENT_DIRECTORY=$(pwd)
2021-07-04 02:33:15 +10:00
2022-07-26 07:46:51 +10:00
cd "${OUT_DIRECTORY}" || exit
2022-02-23 10:36:46 +11:00
2022-07-26 07:48:28 +10:00
if [[ ! -f "mgba-${MGBA_VERSION}.tar.gz" ]]; then
curl -L "https://github.com/mgba-emu/mgba/archive/refs/tags/${MGBA_VERSION}.tar.gz" -o "mgba-${MGBA_VERSION}.tar.gz"
fi
2022-02-23 10:36:46 +11:00
if [[ -f libmgba-cycle.a ]]; then
exit 0
fi
2022-07-26 07:46:51 +10:00
curl -L "https://github.com/mgba-emu/mgba/archive/refs/tags/${MGBA_VERSION}.tar.gz" -o "mgba-${MGBA_VERSION}.tar.gz"
tar -xvf "mgba-${MGBA_VERSION}.tar.gz"
cd "mgba-${MGBA_VERSION}" || exit
2021-07-04 02:33:15 +10:00
rm -rf build
2022-07-26 07:46:51 +10:00
patch --strip=1 < "${CURRENT_DIRECTORY}/add_cycles_register.patch"
2021-07-04 02:33:15 +10:00
mkdir -p build
2022-07-26 07:46:51 +10:00
cd build || exit
2021-07-04 03:30:49 +10:00
cmake .. \
-DBUILD_STATIC=ON \
-DBUILD_SHARED=OFF \
-DDISABLE_FRONTENDS=ON \
-DBUILD_GL=OFF \
-DBUILD_GLES2=OFF \
-DUSE_GDB_STUB=OFF \
-DUSE_FFMPEG=OFF \
-DUSE_ZLIB=OFF \
-DUSE_MINIZIP=OFF \
-DUSE_PNG=OFF \
-DUSE_LIBZIP=OFF \
-DUSE_SQLITE3=OFF \
-DUSE_ELF=ON \
-DM_CORE_GBA=ON \
-DM_CORE_GB=OFF \
-DUSE_LZMA=OFF \
-DUSE_DISCORD_RPC=OFF \
-DENABLE_SCRIPTING=OFF \
2021-07-14 07:24:08 +10:00
-DCMAKE_BUILD_TYPE=Debug \
2021-07-04 03:30:49 +10:00
-DUSE_EPOXY=OFF
2021-07-04 02:33:15 +10:00
make
cp libmgba.a ../../libmgba-cycle.a