add 'developer' option to decouple cheats etc. from build type

developer=true  --> DEBUG macro is set, regardless of build type
    developer=false --> DEBUG macro is not set, regardless of build type
    developer=auto  --> DEBUG macro is set only on debug* build types;
    this matches old behavior and is the default.
This commit is contained in:
Andrei Alexeyev 2019-01-25 02:02:56 +02:00
parent fa802dbd94
commit 9af300d4df
No known key found for this signature in database
GPG key ID: 363707CD4C7FE8A4
5 changed files with 13 additions and 4 deletions

View file

@ -196,8 +196,9 @@ else
endif
is_debug_build = get_option('buildtype').startswith('debug')
is_developer_build = (get_option('developer') == 'auto' ? is_debug_build : get_option('developer') == 'true')
config.set('TAISEI_BUILDCONF_DEBUG', is_debug_build)
config.set('TAISEI_BUILDCONF_DEVELOPER', is_developer_build)
config.set('TAISEI_BUILDCONF_LOG_ENABLE_BACKTRACE', is_debug_build and have_backtrace)
config.set('TAISEI_BUILDCONF_LOG_FATAL_MSGBOX', host_machine.system() == 'windows' or host_machine.system() == 'darwin')
config.set('TAISEI_BUILDCONF_DEBUG_OPENGL', get_option('debug_opengl'))

View file

@ -4,6 +4,13 @@ option(
description : 'Overrides the version string when not building in a git repository'
)
option(
'developer',
type : 'combo',
choices : ['auto', 'true', 'false'],
description : 'Make a "developer" build with cheats and extra debugging features'
)
option(
'enable_audio',
type : 'combo',

View file

@ -14,7 +14,7 @@ stages_src = files(
'stage6_events.c',
)
if is_debug_build
if is_developer_build
stages_src += files(
'dpstest.c',
)

View file

@ -14,7 +14,8 @@
#include "build_config.h"
#include "util/compat.h"
#ifdef TAISEI_BUILDCONF_DEBUG
#ifdef TAISEI_BUILDCONF_DEVELOPER
// TODO: maybe rename this
#define DEBUG 1
#endif

View file

@ -19,7 +19,7 @@ sse42_src += files(
'sse42.c',
)
if is_debug_build
if is_developer_build
util_src += files('debug.c')
endif