[dconf: 17/21] build: Do not make heavy use of project_name



commit 11085f91c24dd895dfd1e9d02a71f1a3346e3c00
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Sat Aug 11 13:57:42 2018 +0200

    build: Do not make heavy use of project_name
    
    The current meson build files make heavy use of meson's
    `project_name` function. However this makes difficult for any
    developer to find for given program/library/file names. The project
    name is also never going to change.
    
    Due to this reason these calls have been changed for `dconf` itself.

 bin/meson.build       |  2 +-
 client/meson.build    | 28 ++++++++++++++--------------
 common/meson.build    | 10 ++++------
 docs/meson.build      |  8 ++++----
 engine/meson.build    |  6 ++----
 gdbus/meson.build     | 14 +++++---------
 gsettings/meson.build |  6 ++----
 gvdb/meson.build      |  4 +---
 shm/meson.build       | 10 +++-------
 tests/meson.build     |  2 +-
 10 files changed, 37 insertions(+), 53 deletions(-)
---
diff --git a/bin/meson.build b/bin/meson.build
index dc220cc..bb6a5d5 100644
--- a/bin/meson.build
+++ b/bin/meson.build
@@ -12,7 +12,7 @@ deps = [
 ]
 
 executable(
-  meson.project_name(),
+  'dconf',
   sources,
   include_directories: top_inc,
   dependencies: deps,
diff --git a/client/meson.build b/client/meson.build
index a526c11..776665e 100644
--- a/client/meson.build
+++ b/client/meson.build
@@ -2,21 +2,21 @@ client_inc = include_directories('.')
 
 install_headers(
   'dconf.h',
-  subdir: meson.project_name()
+  subdir: 'dconf'
 )
 
 install_headers(
   'dconf-client.h',
-  subdir: join_paths(meson.project_name(), 'client')
+  subdir: join_paths('dconf', 'client')
 )
 
-name = meson.project_name() + '-client'
+sources = files('dconf-client.c')
 
-cflags = '-DG_LOG_DOMAIN="@0@"'.format(meson.project_name())
+cflags = '-DG_LOG_DOMAIN="dconf"'
 
 libdconf_client = static_library(
-  name,
-  sources: name + '.c',
+  'dconf-client',
+  sources: sources,
   include_directories: top_inc,
   dependencies: libdconf_gdbus_thread_dep,
   c_args: cflags,
@@ -29,8 +29,8 @@ libdconf_client_dep = declare_dependency(
 )
 
 libdconf = shared_library(
-  meson.project_name(),
-  sources: name + '.c',
+  'dconf',
+  sources: sources,
   version: libversion,
   soversion: soversion,
   include_directories: top_inc,
@@ -48,17 +48,17 @@ libdconf_dep = declare_dependency(
 pkg.generate(
   libraries: libdconf,
   version: meson.project_version(),
-  name: meson.project_name(),
-  description: meson.project_name() + ' client library',
-  filebase: meson.project_name(),
-  subdirs: meson.project_name(),
+  name: 'dconf',
+  description: 'dconf client library',
+  filebase: 'dconf',
+  subdirs: 'dconf',
   requires: 'gio-2.0 ' + gio_req_version,
   variables: 'exec_prefix=${prefix}'
 )
 
-libdconf_vapi = files(meson.project_name() + '.vapi')
+libdconf_vapi = files('dconf.vapi')
 
-vapi_data = libdconf_vapi + files(meson.project_name() + '.deps')
+vapi_data = libdconf_vapi + files('dconf.deps')
 
 install_data(
   vapi_data,
diff --git a/common/meson.build b/common/meson.build
index 51eb939..00f27ad 100644
--- a/common/meson.build
+++ b/common/meson.build
@@ -8,21 +8,19 @@ headers = files(
 
 install_headers(
   headers,
-  subdir: join_paths(meson.project_name(), 'common')
+  subdir: join_paths('dconf', 'common')
 )
 
-name = meson.project_name() + '-common'
-
 sources = files(
   'dconf-changeset.c',
   'dconf-error.c',
   'dconf-paths.c'
 )
 
-cflags = ['-DG_LOG_DOMAIN="@0@"'.format(meson.project_name())]
+cflags = ['-DG_LOG_DOMAIN="dconf"']
 
 libdconf_common = static_library(
-  name,
+  'dconf-common',
   sources: sources,
   include_directories: top_inc,
   dependencies: glib_dep,
@@ -38,7 +36,7 @@ libdconf_common_dep = declare_dependency(
 cflags += cc.get_supported_arguments('-fvisibility=hidden')
 
 libdconf_common_hidden = static_library(
-  name + '-hidden',
+  'dconf-common-hidden',
   sources: sources,
   include_directories: top_inc,
   dependencies: glib_dep,
diff --git a/docs/meson.build b/docs/meson.build
index ed3e45a..46905fd 100644
--- a/docs/meson.build
+++ b/docs/meson.build
@@ -1,16 +1,16 @@
 if get_option('gtk_doc')
   gnome.gtkdoc(
-    meson.project_name(),
-    main_xml: meson.project_name() + '-docs.xml',
+    'dconf',
+    main_xml: 'dconf-docs.xml',
     src_dir: [
       common_inc,
       client_inc
     ],
     dependencies: libdconf_dep,
     scan_args: '--rebuild-types',
-    gobject_typesfile: meson.project_name() + '.types',
+    gobject_typesfile: 'dconf.types',
     install: true,
-    install_dir: join_paths(dconf_prefix, gnome.gtkdoc_html_dir(meson.project_name()))
+    install_dir: join_paths(dconf_prefix, gnome.gtkdoc_html_dir('dconf'))
   )
 endif
 
diff --git a/engine/meson.build b/engine/meson.build
index c4ed442..0705c75 100644
--- a/engine/meson.build
+++ b/engine/meson.build
@@ -13,14 +13,12 @@ deps = [
   libgvdb_dep
 ]
 
-cflags = '-DG_LOG_DOMAIN="@0@"'.format(meson.project_name())
-
 libdconf_engine = static_library(
-  meson.project_name() + '-engine',
+  'dconf-engine',
   sources: sources,
   include_directories: top_inc,
   dependencies: deps + [libdconf_shm_dep],
-  c_args: cflags,
+  c_args: '-DG_LOG_DOMAIN="dconf"',
   pic: true
 )
 
diff --git a/gdbus/meson.build b/gdbus/meson.build
index 1aef9fb..666824f 100644
--- a/gdbus/meson.build
+++ b/gdbus/meson.build
@@ -1,10 +1,8 @@
-name = meson.project_name() + '-gdbus-thread'
-
-cflags = '-DG_LOG_DOMAIN="@0@"'.format(meson.project_name())
+cflags = '-DG_LOG_DOMAIN="dconf"'
 
 libdconf_gdbus_thread = static_library(
-  name,
-  sources: name + '.c',
+  'dconf-gdbus-thread',
+  sources: 'dconf-gdbus-thread.c',
   include_directories: top_inc,
   dependencies: libdconf_engine_dep,
   c_args: cflags,
@@ -16,11 +14,9 @@ libdconf_gdbus_thread_dep = declare_dependency(
   link_with: libdconf_gdbus_thread
 )
 
-name = meson.project_name() + '-gdbus-filter'
-
 libdconf_gdbus_filter = static_library(
-  name,
-  sources: name + '.c',
+  'dconf-gdbus-filter',
+  sources: 'dconf-gdbus-filter.c',
   include_directories: top_inc,
   dependencies: libdconf_engine_dep,
   c_args: cflags,
diff --git a/gsettings/meson.build b/gsettings/meson.build
index c1e9104..29fc7c5 100644
--- a/gsettings/meson.build
+++ b/gsettings/meson.build
@@ -3,14 +3,12 @@ deps = [
   libdconf_gdbus_thread_dep
 ]
 
-cflags = '-DG_LOG_DOMAIN="@0@"'.format(meson.project_name())
-
 libdconf_settings = shared_library(
-  meson.project_name() + 'settings',
+  'dconfsettings',
   sources: 'dconfsettingsbackend.c',
   include_directories: top_inc,
   dependencies: deps,
-  c_args: cflags,
+  c_args: '-DG_LOG_DOMAIN="dconf"',
   install: true,
   install_dir: gio_module_dir
 )
diff --git a/gvdb/meson.build b/gvdb/meson.build
index 5010e27..ebd23b4 100644
--- a/gvdb/meson.build
+++ b/gvdb/meson.build
@@ -7,14 +7,12 @@ deps = [
   glib_dep
 ]
 
-cflags = '-DG_LOG_DOMAIN="gvdb (via @0@)"'.format(meson.project_name())
-
 libgvdb = static_library(
   'gvdb',
   sources: sources,
   include_directories: top_inc,
   dependencies: deps,
-  c_args: cflags,
+  c_args: '-DG_LOG_DOMAIN="gvdb (via dconf)"',
   pic: true
 )
 
diff --git a/shm/meson.build b/shm/meson.build
index 4f95b98..42fe03a 100644
--- a/shm/meson.build
+++ b/shm/meson.build
@@ -1,13 +1,9 @@
-name = meson.project_name() + '-shm'
-
-cflags = '-DG_LOG_DOMAIN="@0@"'.format(meson.project_name())
-
 libdconf_shm = static_library(
-  name,
-  sources: name + '.c',
+  'dconf-shm',
+  sources: 'dconf-shm.c',
   include_directories: top_inc,
   dependencies: glib_dep,
-  c_args: cflags,
+  c_args: '-DG_LOG_DOMAIN="dconf"',
   pic: true
 )
 
diff --git a/tests/meson.build b/tests/meson.build
index 83bb446..96e45dc 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -5,7 +5,7 @@ sources = files(
 )
 
 libdconf_mock = static_library(
-  meson.project_name() + '-mock',
+  'dconf-mock',
   sources: sources,
   dependencies: glib_dep
 )


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