summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <withnall@endlessm.com>2019-08-21 10:25:05 +0300
committerPhilip Withnall <withnall@endlessm.com>2019-08-21 10:25:05 +0300
commit4a8b5635bfd2bb1f7ac188b87fb9e8eb967e79d0 (patch)
tree53fba05e799a8cc07f771b43fc7f84a745f460d0
parenta6591d3f9a22161b79547fd0a12a54fc01dd8630 (diff)
downloadlibgdata-4a8b5635bfd2bb1f7ac188b87fb9e8eb967e79d0.tar.gz
build: Define G_LOG_DOMAIN in c_args rather than config.h
Defining it in `config.h` means that *every* C file which emits a log or debug message needs to remember to include `config.h`. It’s a lot simpler and less error-prone to define `G_LOG_DOMAIN` in the `c_args` instead. Signed-off-by: Philip Withnall <withnall@endlessm.com> Fixes: #30
-rw-r--r--gdata/meson.build1
-rw-r--r--meson.build1
2 files changed, 1 insertions, 1 deletions
diff --git a/gdata/meson.build b/gdata/meson.build
index d221800c..10a0b65d 100644
--- a/gdata/meson.build
+++ b/gdata/meson.build
@@ -138,6 +138,7 @@ libgdata_lib = shared_library(
'gdata',
include_directories: incs,
sources: sources + enum_headers + marshal_files,
+ c_args: ['-DG_LOG_DOMAIN="@0@"'.format(gdata_name)],
dependencies: gdata_deps + gdata_private_deps,
link_args: ldflags,
link_depends: symbol_map,
diff --git a/meson.build b/meson.build
index ad2b0140..36d8cc1c 100644
--- a/meson.build
+++ b/meson.build
@@ -53,7 +53,6 @@ config_h.set_quoted('VERSION', gdata_version)
config_h.set('_GNU_SOURCE', true)
config_h.set_quoted('GETTEXT_PACKAGE', 'gdata')
-config_h.set_quoted('G_LOG_DOMAIN', gdata_name)
gnome = import('gnome')
pkgconfig = import('pkgconfig')