meson: set is_debug_build at beginning of script

This commit is contained in:
Daniel Eklöf 2019-05-12 10:49:22 +02:00
parent d52b490e9d
commit c4337f7d2a

View file

@ -7,6 +7,7 @@ project('f00bar', 'c',
'werror=true', 'werror=true',
'b_ndebug=if-release']) 'b_ndebug=if-release'])
is_debug_build = get_option('buildtype').startswith('debug')
plugs_as_libs = get_option('core-plugins-as-shared-libraries') plugs_as_libs = get_option('core-plugins-as-shared-libraries')
version = '"@0@"'.format(meson.project_version()) version = '"@0@"'.format(meson.project_version())
@ -62,7 +63,7 @@ backend_wayland = wayland_client.found() and wayland_cursor.found() and wlroots.
add_project_arguments( add_project_arguments(
['-D_GNU_SOURCE', ['-D_GNU_SOURCE',
'-DF00BAR_VERSION=@0@'.format(version)] + '-DF00BAR_VERSION=@0@'.format(version)] +
(get_option('buildtype').startswith('debug') ? ['-D_DEBUG'] : []) + (is_debug_build ? ['-D_DEBUG'] : []) +
(backend_x11 ? ['-DENABLE_X11'] : []) + (backend_x11 ? ['-DENABLE_X11'] : []) +
(backend_wayland ? ['-DENABLE_WAYLAND'] : []) + (backend_wayland ? ['-DENABLE_WAYLAND'] : []) +
(plugs_as_libs ? ['-DCORE_PLUGINS_AS_SHARED_LIBRARIES'] : []), (plugs_as_libs ? ['-DCORE_PLUGINS_AS_SHARED_LIBRARIES'] : []),