diff --git a/clutter/meson.build b/clutter/meson.build index ab34c74c4..c914a2284 100644 --- a/clutter/meson.build +++ b/clutter/meson.build @@ -12,19 +12,18 @@ clutter_c_args = [ ] clutter_debug_c_args = [] -if buildtype.startswith('debug') - clutter_debug_c_args += '-DG_DISABLE_CAST_CHECKS' - if buildtype == 'debug' - clutter_debug_c_args += '-DCLUTTER_ENABLE_DEBUG' - endif -elif buildtype == 'release' +if get_option('debug') + clutter_debug_c_args += [ + '-DCLUTTER_ENABLE_DEBUG' + ] +elif buildtype != 'plain' clutter_debug_c_args += [ '-DG_DISABLE_ASSERT', '-DG_DISABLE_CHECKS', '-DG_DISABLE_CAST_CHECKS', ] endif - +supported_clutter_debug_c_args = cc.get_supported_arguments(clutter_debug_c_args) clutter_c_args += clutter_debug_c_args clutter_pkg_deps = [ diff --git a/cogl/meson.build b/cogl/meson.build index 30e241438..585e71697 100644 --- a/cogl/meson.build +++ b/cogl/meson.build @@ -87,19 +87,21 @@ if have_gles2 endif cogl_debug_c_args = [] -if buildtype.startswith('debug') +buildtype = get_option('buildtype') +if get_option('debug') cogl_debug_c_args += [ '-DCOGL_GL_DEBUG', '-DCOGL_OBJECT_DEBUG', '-DCOGL_ENABLE_DEBUG', + '-fno-omit-frame-pointer' ] -elif buildtype == 'release' +elif buildtype != 'plain' cogl_debug_c_args += [ '-DG_DISABLE_CHECKS', - '-DG_DISABLE_CAST_CHECKS', + '-DG_DISABLE_CAST_CHECKS' ] endif - +supported_cogl_debug_c_args = cc.get_supported_arguments(cogl_debug_c_args) cogl_c_args += cogl_debug_c_args if have_cogl_tests diff --git a/meson.build b/meson.build index 08b9ba73a..961c47f8b 100644 --- a/meson.build +++ b/meson.build @@ -318,12 +318,14 @@ supported_warnings = cc.get_supported_arguments(all_warnings) add_project_arguments(supported_warnings, language: 'c') -debug_c_args = [] -buildtype = get_option('buildtype') -if buildtype.startswith('debug') - debug_c_args += '-DG_ENABLE_DEBUG' +if get_option('debug') + debug_c_args = [ + '-DG_ENABLE_DEBUG', + '-fno-omit-frame-pointer' + ] + supported_debug_c_args = cc.get_supported_arguments(debug_c_args) + add_project_arguments(supported_debug_c_args, language: 'c') endif -add_project_arguments(debug_c_args, language: 'c') cc.compiles('void main (void) { __builtin_ffsl (0); __builtin_popcountl (0); }')