[dconf] Declare libdconf_service as a dependency



commit bf103302332603a637f1c33e603c93b82aa1dc0b
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Aug 21 22:44:51 2018 +0100

    Declare libdconf_service as a dependency
    
    The dconf-service internal static library depends on generated files,
    and we need to make sure that those files are available by the time we
    build the tests that depend on them, as Meson builds everything in
    parallel. If we don't do that, in cases of massive parallelised
    builders, we will end up with errors like:
    
    ```
    ccache cc -Itests/tests@@writer@exe -Itests -I../tests -I. -I../ -Itests/../service -I../tests/../service 
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 
-Wall -Winvalid-pch -O0 -g '-DSYSCONFDIR="/etc"' -fno-common -Wmissing-prototypes -Wwrite-strings -O2 -g -m64 
-mtune=generic '-DSRCDIR="/ostbuild/source/dconf/tests"'  -MD -MQ 'tests/tests@@writer@exe/writer.c.o' -MF 
'tests/tests@@writer@exe/writer.c.o.d' -o 'tests/tests@@writer@exe/writer.c.o' -c ../tests/writer.c
    ../tests/writer.c:24:37: fatal error: service/dconf-generated.h: No such file or directory
    ```
    
    Reviewed-by: nobody
    Signed-off-by: Emmanuele Bassi <ebassi gnome org>

 service/meson.build | 10 +++++++++-
 tests/meson.build   |  2 +-
 2 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/service/meson.build b/service/meson.build
index 35ee23a..7d54805 100644
--- a/service/meson.build
+++ b/service/meson.build
@@ -23,13 +23,15 @@ sources = [
   'main.c',
 ]
 
-lib_sources += gnome.gdbus_codegen(
+dconf_generated = gnome.gdbus_codegen(
   'dconf-generated',
   dconf_namespace + '.xml',
   interface_prefix: dconf_namespace + '.',
   namespace: 'DConfDBus',
 )
 
+lib_sources += dconf_generated
+
 libdconf_service = static_library(
   'dconf-service',
   sources: lib_sources,
@@ -43,6 +45,12 @@ libdconf_service = static_library(
   ],
 )
 
+libdconf_service_dep = declare_dependency(
+  link_with: libdconf_service,
+  dependencies: gio_unix_dep,
+  sources: dconf_generated,
+)
+
 executable(
   'dconf-service',
   sources,
diff --git a/tests/meson.build b/tests/meson.build
index 3274059..d1471b4 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -30,7 +30,7 @@ unit_tests = [
   ['gdbus-filter', 'dbus.c', '-DDBUS_BACKEND="/gdbus/filter"', libdconf_gdbus_filter_dep, []],
   ['engine', 'engine.c', '-DSRCDIR="@0@"'.format(test_dir), [dl_dep, libdconf_engine_dep, m_dep], 
libdconf_mock],
   ['client', 'client.c', '-DSRCDIR="@0@"'.format(test_dir), [libdconf_client_dep, libdconf_engine_dep], 
libdconf_mock],
-  ['writer', 'writer.c', '-DSRCDIR="@0@"'.format(test_dir), [glib_dep, dl_dep, m_dep], [libdconf_service, 
libdconf_mock]],
+  ['writer', 'writer.c', '-DSRCDIR="@0@"'.format(test_dir), [glib_dep, dl_dep, m_dep, libdconf_service_dep], 
[libdconf_mock]],
 ]
 
 foreach unit_test: unit_tests


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