-
Notifications
You must be signed in to change notification settings - Fork 65
/
build.sh
executable file
·31 lines (27 loc) · 1.14 KB
/
build.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
#!/bin/sh
set -e
target="test"
if [ "$#" -ge 1 ]; then
target="$1"
shift
fi
# Set up env variable to show % of completion during ninja build
export NINJA_STATUS="[%p %f/%t] "
# Explicitly set the Response File threshold to half of Wine's limit
# Must be here in addition to in config.sh for when Meson automatically triggers a reconfigure
# Ref: https://github.com/mesonbuild/meson/blob/8e89a38737281f7618a1284fe9e68eb6bb1fe99d/mesonbuild/backend/ninjabackend.py#L108
# Ref: https://github.com/wine-mirror/wine/blob/34b1606019982b71818780bc84b76460f650af31/dlls/ntdll/unix/env.c#L1579
# TODO: https://github.com/mesonbuild/meson/issues/13414
export MESON_RSP_THRESHOLD=16387
# Build the project
"${MESON:-meson}" configure build "-Dgdb_debugging=false"
if [ "$target" = test ]; then
"${MESON:-meson}" test -C build "$@"
elif [ "$target" = rom ]; then
"${MESON:-meson}" compile -C build "pokeplatinum.us.nds"
elif [ "$target" = debug ]; then
"${MESON:-meson}" configure build "-Dgdb_debugging=true"
"${MESON:-meson}" compile -C build "pokeplatinum.us.nds" "debug.nef" "overlay.map"
else
"${MESON:-meson}" compile -C build "$target" "$@"
fi