build: allow -Dtracing for more logging information

This commit is contained in:
Christian Hergert 2023-04-20 13:58:48 -07:00
parent 5c12eac44f
commit cd7825d9d5
3 changed files with 11 additions and 3 deletions

View File

@ -33,13 +33,13 @@ G_BEGIN_DECLS
CAIRO_VERSION_MICRO >= (micro))) CAIRO_VERSION_MICRO >= (micro)))
#ifdef MKS_DEBUG #ifdef MKS_DEBUG
# define MKS_ENTRY G_STMT_START { g_debug("ENTRY: %s():%u", G_STRFUNC, __LINE__) } G_STMT_END # define MKS_ENTRY G_STMT_START { g_debug("ENTRY: %s():%u", G_STRFUNC, __LINE__); } G_STMT_END
# define MKS_EXIT G_STMT_START { g_debug(" EXIT: %s():%u", G_STRFUNC, __LINE__); return; } G_STMT_END # define MKS_EXIT G_STMT_START { g_debug(" EXIT: %s():%u", G_STRFUNC, __LINE__); return; } G_STMT_END
# define MKS_RETURN(_r) G_STMT_START { g_debug(" EXIT: %s():%u", G_STRFUNC, __LINE__); return (_r); } G_STMT_END # define MKS_RETURN(_r) G_STMT_START { typeof(_r) __ret = (_r); g_debug(" EXIT: %s():%u", G_STRFUNC, __LINE__); return __ret; } G_STMT_END
#else #else
# define MKS_ENTRY G_STMT_START { } G_STMT_END # define MKS_ENTRY G_STMT_START { } G_STMT_END
# define MKS_EXIT G_STMT_START { return; } G_STMT_END # define MKS_EXIT G_STMT_START { return; } G_STMT_END
# define MKS_RETURN(_r) G_STMT_START { return (_r); } G_STMT_END # define MKS_RETURN(_r) G_STMT_START { typeof(_r) __ret = (_r); return (__ret); } G_STMT_END
#endif #endif
gboolean mks_scroll_event_is_inverted (GdkEvent *event); gboolean mks_scroll_event_is_inverted (GdkEvent *event);

View File

@ -16,6 +16,9 @@ project_c_args = ['-DMKS_COMPILATION']
config_h = configuration_data() config_h = configuration_data()
config_h.set_quoted('GETTEXT_PACKAGE', 'libmks-@0@'.format(api_version)) config_h.set_quoted('GETTEXT_PACKAGE', 'libmks-@0@'.format(api_version))
config_h.set_quoted('PACKAGE_VERSION', meson.project_version()) config_h.set_quoted('PACKAGE_VERSION', meson.project_version())
if get_option('tracing')
config_h.set10('MKS_DEBUG', true)
endif
add_project_arguments(['-I' + meson.project_build_root()], language: 'c') add_project_arguments(['-I' + meson.project_build_root()], language: 'c')
# Check dependencies # Check dependencies

View File

@ -9,3 +9,8 @@ option('introspection',
description: 'Generate gir data') description: 'Generate gir data')
option('vapi', type: 'boolean', value: true) option('vapi', type: 'boolean', value: true)
option('tracing',
type: 'boolean',
value: false,
description: 'Enable developer tracing information in logs')