[dconf: 3/9] service: Split most code into a static helper library



commit 61e6f961aeea1a024e4e1af096e9b4c9b3abfdcb
Author: Philip Withnall <withnall endlessm com>
Date:   Mon Aug 13 15:01:34 2018 +0100

    service: Split most code into a static helper library
    
    This will make unit testing the code easier.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>

 service/meson.build | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)
---
diff --git a/service/meson.build b/service/meson.build
index 618cbd5..6de68bd 100644
--- a/service/meson.build
+++ b/service/meson.build
@@ -11,35 +11,43 @@ configure_file(
   install_dir: dbus_session_service_dir,
 )
 
-sources = [
+lib_sources = [
   'dconf-blame.c',
   'dconf-gvdb-utils.c',
   'dconf-keyfile-writer.c',
   'dconf-service.c',
   'dconf-shm-writer.c',
   'dconf-writer.c',
+]
+sources = [
   'main.c',
 ]
 
-sources += gnome.gdbus_codegen(
+lib_sources += gnome.gdbus_codegen(
   'dconf-generated',
   dconf_namespace + '.xml',
   interface_prefix: dconf_namespace + '.',
   namespace: 'DConfDBus',
 )
 
-service_deps = [
-  gio_unix_dep,
-  libdconf_common_dep,
-  libdconf_shm_dep,
-  libgvdb_dep,
-]
+libdconf_service = static_library(
+  'dconf-service',
+  sources: lib_sources,
+  include_directories: top_inc,
+  dependencies: gio_unix_dep,
+  link_with: [
+    libdconf_common,
+    libdconf_shm,
+    libgvdb,
+  ],
+)
 
 executable(
   'dconf-service',
   sources,
   include_directories: top_inc,
-  dependencies: service_deps,
+  dependencies: gio_unix_dep,
+  link_with: libdconf_service,
   install: true,
   install_dir: dconf_libexecdir,
 )


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