[glib] Meson: Define G_ENABLE_DEBUG and friends



commit cc7e0f6cc20b41be8ee667c3b59130caab56332d
Author: Xavier Claessens <xavier claessens collabora com>
Date:   Wed Mar 28 21:37:38 2018 -0400

    Meson: Define G_ENABLE_DEBUG and friends
    
    https://bugzilla.gnome.org/show_bug.cgi?id=794790

 meson.build | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/meson.build b/meson.build
index b11726947..b52d4d857 100644
--- a/meson.build
+++ b/meson.build
@@ -2,6 +2,7 @@ project('glib', 'c', 'cpp',
   version : '2.57.0',
   meson_version : '>= 0.45.0',
   default_options : [
+    'buildtype=debugoptimized',
     'warning_level=1',
     'c_std=gnu89'
   ]
@@ -190,6 +191,15 @@ glibconfig_conf.set('glib_os', glib_os)
 # for dependencies that don't normally come with pkg-config files for Visual Studio builds
 buildtype = get_option('buildtype')
 
+glib_debug_cflags = []
+if buildtype.startswith('debug')
+  glib_debug_cflags += ['-DG_ENABLE_DEBUG']
+elif buildtype == 'release'
+  glib_debug_cflags += ['-DG_DISABLE_CAST_CHECKS']
+endif
+
+add_project_arguments(glib_debug_cflags, language: 'c')
+
 # check for header files
 
 headers = [


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]