mirror of
https://github.com/pret/pokeplatinum.git
synced 2024-11-23 05:49:44 +00:00
add build option to enable or disable debugging code
This commit is contained in:
parent
37222bb7af
commit
d43f2c4e67
2
build.sh
2
build.sh
@ -18,11 +18,13 @@ export NINJA_STATUS="[%p %f/%t] "
|
||||
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" "$@"
|
||||
|
@ -13,10 +13,6 @@ void Overlay_UnloadByID(const FSOverlayID param0);
|
||||
int Overlay_GetLoadDestination(const FSOverlayID param0);
|
||||
BOOL Overlay_LoadByID(const FSOverlayID param0, int param1);
|
||||
|
||||
// TODO: this should integrate into build system instead of a manual define here.
|
||||
// to turn off overlay debugging and build a matching ROM, undefine this.
|
||||
// #define GDB_DEBUGGING
|
||||
|
||||
#ifdef GDB_DEBUGGING
|
||||
// describes a single overlay entry, which GDB can inspect to determine which overlays are loaded.
|
||||
typedef struct {
|
||||
|
20
meson.build
20
meson.build
@ -19,7 +19,6 @@ public_includes = include_directories('include', 'asm', 'res')
|
||||
### COMPILER FLAGS ###
|
||||
############################################################
|
||||
c_args = [
|
||||
'-O4,p',
|
||||
'-proc', 'arm946e',
|
||||
'-enum', 'int',
|
||||
'-lang', 'c99',
|
||||
@ -35,6 +34,15 @@ c_args = [
|
||||
'-sym', 'on'
|
||||
]
|
||||
|
||||
if get_option('gdb_debugging')
|
||||
c_args += [
|
||||
'-O1,p',
|
||||
'-inline', 'off'
|
||||
]
|
||||
else
|
||||
c_args += '-O4,p'
|
||||
endif
|
||||
|
||||
add_global_arguments(c_args,
|
||||
language: 'c',
|
||||
native: false
|
||||
@ -46,6 +54,10 @@ pokeplatinum_args = [
|
||||
'-DGAME_LANGUAGE=ENGLISH'
|
||||
]
|
||||
|
||||
if get_option('gdb_debugging')
|
||||
pokeplatinum_args += '-DGDB_DEBUGGING'
|
||||
endif
|
||||
|
||||
asm_args = [
|
||||
'-proc', 'arm5TE',
|
||||
'-16',
|
||||
@ -240,8 +252,7 @@ nef_fixer = custom_target('debug.nef',
|
||||
],
|
||||
command : [
|
||||
nef_fixer_py, '@INPUT@', '@OUTPUT@'
|
||||
],
|
||||
build_by_default: true
|
||||
]
|
||||
)
|
||||
|
||||
ovly_mapper = custom_target('overlay.map',
|
||||
@ -253,8 +264,7 @@ ovly_mapper = custom_target('overlay.map',
|
||||
],
|
||||
command : [
|
||||
overlay_mapper_py, '@INPUT@', '@OUTPUT@'
|
||||
],
|
||||
build_by_default: true
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
|
1
meson.options
Normal file
1
meson.options
Normal file
@ -0,0 +1 @@
|
||||
option('gdb_debugging', type : 'boolean', value : false)
|
Loading…
Reference in New Issue
Block a user