Skip to content
Snippets Groups Projects
Commit b3c5d20f authored by Gaël Bonithon's avatar Gaël Bonithon
Browse files

meson-build: Update debug/optimization flag management

Related: xfce/xfce4-dev-tools!145
parent 430d3c8a
Branches master
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@ project(
version : '4.20.0-dev',
license : 'GPL-2',
meson_version : '>= 0.58.0',
default_options : ['c_std=gnu11', 'buildtype=debugoptimized', 'warning_level=2', 'b_ndebug=if-release']
default_options : ['c_std=gnu11', 'buildtype=debugoptimized', 'warning_level=2']
)
project_namespace = 'xfce'
......@@ -158,18 +158,15 @@ extra_cflags_check = [
'-Wno-error=deprecated-declarations',
]
buildtype = get_option('buildtype')
if buildtype == 'debug' or buildtype == 'debugoptimized'
optimization = get_option('optimization')
if get_option('debug') and optimization in ['0', 'g']
extra_cflags_check += '-fstack-protector-strong'
extra_cflags += '-DDEBUG=1'
if buildtype == 'debug'
extra_cflags += [
'-DG_ENABLE_DEBUG',
'-DDEBUG_TRACE=1',
]
endif
elif buildtype == 'minsize'
extra_cflags += [
'-DDEBUG=1',
'-DDEBUG_TRACE=1',
'-DG_ENABLE_DEBUG',
]
elif optimization in ['3', 'minsize']
extra_cflags += [
'-DNDEBUG',
'-DG_DISABLE_CAST_CHECKS',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment