[dconf/wip/inigomartinez/meson: 7/14] build: Avoid building libraries twice



commit 279403ecc1825871a10d6de28c25508bc1852ffb
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Tue Apr 10 22:22:47 2018 +0200

    build: Avoid building libraries twice
    
    dconf builts a number of internal static libraries which in some
    cases are duplicated. This duplication comes from autotools that
    used to built two libraries for each library, one with PIC enabled
    and the other one without it.
    
    This has been changed to build only one library for each library to
    be built, except `libdconf-common-hidden` which hides some symbols
    for the GIO module to be built.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=790236

 client/meson.build    |   10 +++++-----
 common/meson.build    |    8 --------
 engine/meson.build    |   12 +-----------
 gdbus/meson.build     |   24 ++----------------------
 gsettings/meson.build |    8 ++++----
 gvdb/meson.build      |   12 +-----------
 shm/meson.build       |   12 +-----------
 7 files changed, 14 insertions(+), 72 deletions(-)
---
diff --git a/client/meson.build b/client/meson.build
index cb94deb..7767ce6 100644
--- a/client/meson.build
+++ b/client/meson.build
@@ -32,11 +32,11 @@ libdconf = shared_library(
   dependencies: gio_unix_dep,
   c_args: cflags,
   link_with: [
-    libdconf_common_shared,
-    libdconf_engine_shared,
-    libdconf_gdbus_thread_shared,
-    libdconf_shm_shared,
-    libgvdb_shared
+    libdconf_common,
+    libdconf_engine,
+    libdconf_gdbus_thread,
+    libdconf_shm,
+    libgvdb
   ],
   install: true,
   install_dir: dconf_libdir
diff --git a/common/meson.build b/common/meson.build
index 28427f6..6aed690 100644
--- a/common/meson.build
+++ b/common/meson.build
@@ -26,14 +26,6 @@ libdconf_common = static_library(
   sources: sources,
   include_directories: top_inc,
   dependencies: glib_dep,
-  c_args: cflags
-)
-
-libdconf_common_shared = static_library(
-  name + '-shared',
-  sources: sources,
-  include_directories: top_inc,
-  dependencies: glib_dep,
   c_args: cflags,
   pic: true
 )
diff --git a/engine/meson.build b/engine/meson.build
index 58b648f..d68bd5e 100644
--- a/engine/meson.build
+++ b/engine/meson.build
@@ -1,5 +1,3 @@
-name = meson.project_name() + '-engine'
-
 sources = files(
   'dconf-engine.c',
   'dconf-engine-profile.c',
@@ -13,15 +11,7 @@ sources = files(
 cflags = '-DG_LOG_DOMAIN="@0@"'.format(meson.project_name())
 
 libdconf_engine = static_library(
-  name,
-  sources: sources,
-  include_directories: top_inc,
-  dependencies: glib_dep,
-  c_args: cflags
-)
-
-libdconf_engine_shared = static_library(
-  name + '-shared',
+  meson.project_name() + '-engine',
   sources: sources,
   include_directories: top_inc,
   dependencies: glib_dep,
diff --git a/gdbus/meson.build b/gdbus/meson.build
index 4dda78d..c22a81d 100644
--- a/gdbus/meson.build
+++ b/gdbus/meson.build
@@ -1,19 +1,9 @@
-name = meson.project_name() + '-gdbus-thread'
-
 sources = files('dconf-gdbus-thread.c')
 
 cflags = '-DG_LOG_DOMAIN="@0@"'.format(meson.project_name())
 
 libdconf_gdbus_thread = static_library(
-  name,
-  sources: sources,
-  include_directories: top_inc,
-  dependencies: gio_unix_dep,
-  c_args: cflags
-)
-
-libdconf_gdbus_thread_shared = static_library(
-  name + '-shared',
+  meson.project_name() + '-gdbus-thread',
   sources: sources,
   include_directories: top_inc,
   dependencies: gio_unix_dep,
@@ -21,20 +11,10 @@ libdconf_gdbus_thread_shared = static_library(
   pic: true
 )
 
-name = meson.project_name() + '-gdbus-filter'
-
 sources = files('dconf-gdbus-filter.c')
 
 libdconf_gdbus_filter = static_library(
-  name,
-  sources: sources,
-  include_directories: top_inc,
-  dependencies: gio_unix_dep,
-  c_args: cflags
-)
-
-libdconf_gdbus_filter_shared = static_library(
-  name + '-shared',
+  meson.project_name() + '-gdbus-filter',
   sources: sources,
   include_directories: top_inc,
   dependencies: gio_unix_dep,
diff --git a/gsettings/meson.build b/gsettings/meson.build
index 59492d9..775c4c4 100644
--- a/gsettings/meson.build
+++ b/gsettings/meson.build
@@ -10,10 +10,10 @@ libdconf_settings = shared_library(
   c_args: cflags,
   link_with: [
     libdconf_common_hidden,
-    libdconf_engine_shared,
-    libdconf_gdbus_thread_shared,
-    libdconf_shm_shared,
-    libgvdb_shared
+    libdconf_engine,
+    libdconf_gdbus_thread,
+    libdconf_shm,
+    libgvdb
   ],
   install: true,
   install_dir: gio_module_dir
diff --git a/gvdb/meson.build b/gvdb/meson.build
index 4543430..735d268 100644
--- a/gvdb/meson.build
+++ b/gvdb/meson.build
@@ -1,5 +1,3 @@
-name = 'gvdb'
-
 gvdb_builder = files('gvdb-builder.c')
 
 sources = gvdb_builder + files('gvdb-reader.c')
@@ -7,15 +5,7 @@ sources = gvdb_builder + files('gvdb-reader.c')
 cflags = '-DG_LOG_DOMAIN="gvdb (via @0@)"'.format(meson.project_name())
 
 libgvdb = static_library(
-  name,
-  sources: sources,
-  include_directories: top_inc,
-  dependencies: glib_dep,
-  c_args: cflags
-)
-
-libgvdb_shared = static_library(
-  name + '-shared',
+  'gvdb',
   sources: sources,
   include_directories: top_inc,
   dependencies: glib_dep,
diff --git a/shm/meson.build b/shm/meson.build
index 01ced55..d904cd0 100644
--- a/shm/meson.build
+++ b/shm/meson.build
@@ -1,19 +1,9 @@
-name = meson.project_name() + '-shm'
-
 sources = files('dconf-shm.c')
 
 cflags = '-DG_LOG_DOMAIN="@0@"'.format(meson.project_name())
 
 libdconf_shm = static_library(
-  name,
-  sources: sources,
-  include_directories: top_inc,
-  dependencies: glib_dep,
-  c_args: cflags
-)
-
-libdconf_shm_shared = static_library(
-  name + '-shared',
+  meson.project_name() + '-shm',
   sources: sources,
   include_directories: top_inc,
   dependencies: glib_dep,


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