summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorIñigo Martínez <inigomartinez@gmail.com>2017-07-12 16:30:51 +0200
committerMichael Catanzaro <mcatanzaro@igalia.com>2017-10-17 16:32:41 -0500
commitf7a71bd57254912547256045b747f9181eef3529 (patch)
treee7278e8dc0fdddc5b2e6acbd74e72c7626c5f497 /common
parent8ff1b86cb8f6c848be82d99dbb593a50713ce6ad (diff)
downloaddconf-f7a71bd57254912547256045b747f9181eef3529.tar.gz
build: Port to meson build system
meson is a build system focused on speed an ease of use, which helps speeding up the software development. This patch adds meson support along autotools. https://bugzilla.gnome.org/show_bug.cgi?id=784910
Diffstat (limited to 'common')
-rw-r--r--common/Makefile.am2
-rw-r--r--common/meson.build54
2 files changed, 56 insertions, 0 deletions
diff --git a/common/Makefile.am b/common/Makefile.am
index 57f0f32..4bb6f77 100644
--- a/common/Makefile.am
+++ b/common/Makefile.am
@@ -19,3 +19,5 @@ libdconf_common_shared_a_SOURCES = $(libdconf_common_a_SOURCES)
libdconf_common_hidden_a_CFLAGS = $(libdconf_common_a_CFLAGS) -fPIC -DPIC -fvisibility=hidden
libdconf_common_hidden_a_SOURCES = $(libdconf_common_a_SOURCES)
+
+EXTRA_DIST = meson.build
diff --git a/common/meson.build b/common/meson.build
new file mode 100644
index 0000000..c431fe9
--- /dev/null
+++ b/common/meson.build
@@ -0,0 +1,54 @@
+common_inc = include_directories('.')
+
+headers = files(
+ 'dconf-changeset.h',
+ 'dconf-enums.h',
+ 'dconf-paths.h'
+)
+
+install_headers(
+ headers,
+ subdir: join_paths(meson.project_name(), '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())]
+
+libdconf_common = static_library(
+ name,
+ 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
+)
+
+test_cflag = '-fvisibility=hidden'
+
+if cc.has_argument(test_cflag)
+ cflags += [test_cflag]
+endif
+
+libdconf_common_hidden = static_library(
+ name + '-hidden',
+ sources: sources,
+ include_directories: top_inc,
+ dependencies: glib_dep,
+ c_args: cflags,
+ pic: true
+)