[dconf: 5/9] build: Enable G_LOG_USE_STRUCTURED=1



commit ea8c09f14da4b931cdadbabe2be315f6747ac7b7
Author: Philip Withnall <withnall endlessm com>
Date:   Tue Aug 14 16:00:13 2018 +0100

    build: Enable G_LOG_USE_STRUCTURED=1
    
    This enables structured logging for all parts of dconf, which will make
    it easier to check for certain log messages in the unit tests.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>

 client/meson.build    | 6 ++----
 common/meson.build    | 8 ++------
 engine/meson.build    | 2 +-
 gdbus/meson.build     | 6 ++----
 gsettings/meson.build | 2 +-
 gvdb/meson.build      | 7 ++++++-
 meson.build           | 5 +++++
 service/meson.build   | 2 ++
 shm/meson.build       | 2 +-
 9 files changed, 22 insertions(+), 18 deletions(-)
---
diff --git a/client/meson.build b/client/meson.build
index ce425d2..74fb090 100644
--- a/client/meson.build
+++ b/client/meson.build
@@ -12,8 +12,6 @@ install_headers(
 
 sources = files('dconf-client.c')
 
-cflags = '-DG_LOG_DOMAIN="dconf"'
-
 deps = [
   libdconf_common_hidden_dep,
   libdconf_gdbus_thread_dep,
@@ -24,7 +22,7 @@ libdconf_client = static_library(
   sources: sources,
   include_directories: top_inc,
   dependencies: libdconf_gdbus_thread_dep,
-  c_args: cflags,
+  c_args: dconf_c_args,
   pic: true,
 )
 
@@ -40,7 +38,7 @@ libdconf = shared_library(
   soversion: soversion,
   include_directories: top_inc,
   dependencies: deps,
-  c_args: cflags,
+  c_args: dconf_c_args,
   install: true,
 )
 
diff --git a/common/meson.build b/common/meson.build
index 90245b7..58e0fa8 100644
--- a/common/meson.build
+++ b/common/meson.build
@@ -17,14 +17,12 @@ sources = files(
   'dconf-paths.c',
 )
 
-cflags = ['-DG_LOG_DOMAIN="dconf"']
-
 libdconf_common = static_library(
   'dconf-common',
   sources: sources,
   include_directories: top_inc,
   dependencies: glib_dep,
-  c_args: cflags,
+  c_args: dconf_c_args,
   pic: true,
 )
 
@@ -33,14 +31,12 @@ libdconf_common_dep = declare_dependency(
   link_whole: libdconf_common,
 )
 
-cflags += cc.get_supported_arguments('-fvisibility=hidden')
-
 libdconf_common_hidden = static_library(
   'dconf-common-hidden',
   sources: sources,
   include_directories: top_inc,
   dependencies: glib_dep,
-  c_args: cflags,
+  c_args: dconf_c_args + cc.get_supported_arguments('-fvisibility=hidden'),
   pic: true,
 )
 
diff --git a/engine/meson.build b/engine/meson.build
index d578f3f..d1a959d 100644
--- a/engine/meson.build
+++ b/engine/meson.build
@@ -18,7 +18,7 @@ libdconf_engine = static_library(
   sources: sources,
   include_directories: top_inc,
   dependencies: engine_deps + [libdconf_shm_dep],
-  c_args: '-DG_LOG_DOMAIN="dconf"',
+  c_args: dconf_c_args,
   pic: true,
 )
 
diff --git a/gdbus/meson.build b/gdbus/meson.build
index ca07019..4fbf3ec 100644
--- a/gdbus/meson.build
+++ b/gdbus/meson.build
@@ -1,11 +1,9 @@
-cflags = '-DG_LOG_DOMAIN="dconf"'
-
 libdconf_gdbus_thread = static_library(
   'dconf-gdbus-thread',
   sources: 'dconf-gdbus-thread.c',
   include_directories: top_inc,
   dependencies: libdconf_engine_dep,
-  c_args: cflags,
+  c_args: dconf_c_args,
   pic: true,
 )
 
@@ -19,7 +17,7 @@ libdconf_gdbus_filter = static_library(
   sources: 'dconf-gdbus-filter.c',
   include_directories: top_inc,
   dependencies: libdconf_engine_dep,
-  c_args: cflags,
+  c_args: dconf_c_args,
   pic: true,
 )
 
diff --git a/gsettings/meson.build b/gsettings/meson.build
index 8bd6908..a28892d 100644
--- a/gsettings/meson.build
+++ b/gsettings/meson.build
@@ -12,7 +12,7 @@ libdconf_settings = shared_library(
   include_directories: top_inc,
   link_with: backend_deps,
   dependencies: gio_dep,
-  c_args: '-DG_LOG_DOMAIN="dconf"',
+  c_args: dconf_c_args,
   install: true,
   install_dir: gio_module_dir,
 )
diff --git a/gvdb/meson.build b/gvdb/meson.build
index 1309a5b..1a1aba8 100644
--- a/gvdb/meson.build
+++ b/gvdb/meson.build
@@ -7,12 +7,17 @@ gvdb_deps = [
   glib_dep,
 ]
 
+cflags = [
+  '-DG_LOG_DOMAIN="gvdb (via dconf)"',
+  '-DG_LOG_USE_STRUCTURED=1',
+]
+
 libgvdb = static_library(
   'gvdb',
   sources: sources,
   include_directories: top_inc,
   dependencies: gvdb_deps,
-  c_args: '-DG_LOG_DOMAIN="gvdb (via dconf)"',
+  c_args: cflags,
   pic: true,
 )
 
diff --git a/meson.build b/meson.build
index ba14507..788cea9 100644
--- a/meson.build
+++ b/meson.build
@@ -35,6 +35,11 @@ endif
 
 add_project_arguments(common_flags, language: 'c')
 
+dconf_c_args = [
+  '-DG_LOG_DOMAIN="dconf"',
+  '-DG_LOG_USE_STRUCTURED=1',
+]
+
 gio_req_version = '>= 2.25.7'
 
 gio_dep = dependency('gio-2.0', version: gio_req_version)
diff --git a/service/meson.build b/service/meson.build
index 6de68bd..35ee23a 100644
--- a/service/meson.build
+++ b/service/meson.build
@@ -34,6 +34,7 @@ libdconf_service = static_library(
   'dconf-service',
   sources: lib_sources,
   include_directories: top_inc,
+  c_args: dconf_c_args,
   dependencies: gio_unix_dep,
   link_with: [
     libdconf_common,
@@ -46,6 +47,7 @@ executable(
   'dconf-service',
   sources,
   include_directories: top_inc,
+  c_args: dconf_c_args,
   dependencies: gio_unix_dep,
   link_with: libdconf_service,
   install: true,
diff --git a/shm/meson.build b/shm/meson.build
index 57a9852..5fb9fe2 100644
--- a/shm/meson.build
+++ b/shm/meson.build
@@ -3,7 +3,7 @@ libdconf_shm = static_library(
   sources: 'dconf-shm.c',
   include_directories: top_inc,
   dependencies: glib_dep,
-  c_args: '-DG_LOG_DOMAIN="dconf"',
+  c_args: dconf_c_args,
   pic: true,
 )
 


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