Commit c50f3758 authored by Iñigo Martínez's avatar Iñigo Martínez

build: Fix internal dependencies

meson is able to generate internal dependencies for handling built
libraries. These internal dependencies depend on other dependencies
as well, based on the includes exposed by their headers.

This have been fixed by using proper internal dependencies for these
libraries.
parent 183e193b
......@@ -6,6 +6,7 @@ sources = gvdb_builder + libdconf_vapi + files(
)
deps = [
libdconf_common_dep,
libdconf_dep,
valac.find_library('posix')
]
......
......@@ -10,42 +10,40 @@ install_headers(
subdir: join_paths(meson.project_name(), 'client')
)
sources = files('dconf-client.c')
name = meson.project_name() + '-client'
cflags = '-DG_LOG_DOMAIN="@0@"'.format(meson.project_name())
libdconf_client = static_library(
meson.project_name() + '-client',
sources: sources,
name,
sources: name + '.c',
include_directories: top_inc,
dependencies: gio_unix_dep,
dependencies: libdconf_gdbus_thread_dep,
c_args: cflags,
pic: true
)
libdconf_client_dep = declare_dependency(
dependencies: gio_dep,
link_with: libdconf_client
)
libdconf = shared_library(
meson.project_name(),
sources: sources,
sources: name + '.c',
version: libversion,
soversion: soversion,
include_directories: top_inc,
dependencies: gio_unix_dep,
dependencies: deps,
c_args: cflags,
link_with: [
libdconf_common,
libdconf_engine,
libdconf_gdbus_thread,
libdconf_shm,
libgvdb
],
install: true,
install_dir: dconf_libdir
)
libdconf_dep = declare_dependency(
link_with: libdconf,
include_directories: client_inc,
dependencies: gio_unix_dep
dependencies: gio_dep,
link_with: libdconf
)
pkg.generate(
......@@ -55,7 +53,7 @@ pkg.generate(
description: meson.project_name() + ' client library',
filebase: meson.project_name(),
subdirs: meson.project_name(),
requires: 'gio-unix-2.0 ' + gio_unix_req_version,
requires: 'gio-2.0 ' + gio_req_version,
variables: 'exec_prefix=' + dconf_libexecdir,
install_dir: join_paths(dconf_libdir, 'pkgconfig')
)
......
......@@ -30,6 +30,11 @@ libdconf_common = static_library(
pic: true
)
libdconf_common_dep = declare_dependency(
dependencies: glib_dep,
link_with: libdconf_common
)
cflags += cc.get_supported_arguments('-fvisibility=hidden')
libdconf_common_hidden = static_library(
......@@ -40,3 +45,8 @@ libdconf_common_hidden = static_library(
c_args: cflags,
pic: true
)
libdconf_common_hidden_dep = declare_dependency(
dependencies: glib_dep,
link_with: libdconf_common_hidden
)
......@@ -8,13 +8,23 @@ sources = files(
'dconf-engine-source-system.c'
)
deps = [
libdconf_common_dep,
libgvdb_dep
]
cflags = '-DG_LOG_DOMAIN="@0@"'.format(meson.project_name())
libdconf_engine = static_library(
meson.project_name() + '-engine',
sources: sources,
include_directories: top_inc,
dependencies: glib_dep,
dependencies: deps + [libdconf_shm_dep],
c_args: cflags,
pic: true
)
libdconf_engine_dep = declare_dependency(
dependencies: deps,
link_with: libdconf_engine
)
sources = files('dconf-gdbus-thread.c')
name = meson.project_name() + '-gdbus-thread'
cflags = '-DG_LOG_DOMAIN="@0@"'.format(meson.project_name())
libdconf_gdbus_thread = static_library(
meson.project_name() + '-gdbus-thread',
sources: sources,
name,
sources: name + '.c',
include_directories: top_inc,
dependencies: gio_unix_dep,
dependencies: libdconf_engine_dep,
c_args: cflags,
pic: true
)
sources = files('dconf-gdbus-filter.c')
libdconf_gdbus_thread_dep = declare_dependency(
dependencies: libdconf_engine_dep,
link_with: libdconf_gdbus_thread
)
name = meson.project_name() + '-gdbus-filter'
libdconf_gdbus_filter = static_library(
meson.project_name() + '-gdbus-filter',
sources: sources,
name,
sources: name + '.c',
include_directories: top_inc,
dependencies: gio_unix_dep,
dependencies: libdconf_engine_dep,
c_args: cflags,
pic: true
)
libdconf_gdbus_filter_dep = declare_dependency(
dependencies: libdconf_engine_dep,
link_with: libdconf_gdbus_filter
)
sources = files('dconfsettingsbackend.c')
deps = [
libdconf_common_hidden_dep,
libdconf_gdbus_thread_dep
]
cflags = '-DG_LOG_DOMAIN="@0@"'.format(meson.project_name())
libdconf_settings = shared_library(
meson.project_name() + 'settings',
sources: sources,
sources: 'dconfsettingsbackend.c',
include_directories: top_inc,
dependencies: gio_unix_dep,
dependencies: deps,
c_args: cflags,
link_with: [
libdconf_common_hidden,
libdconf_engine,
libdconf_gdbus_thread,
libdconf_shm,
libgvdb
],
install: true,
install_dir: gio_module_dir
)
......
......@@ -2,13 +2,23 @@ gvdb_builder = files('gvdb-builder.c')
sources = gvdb_builder + files('gvdb-reader.c')
deps = [
gio_dep,
glib_dep
]
cflags = '-DG_LOG_DOMAIN="gvdb (via @0@)"'.format(meson.project_name())
libgvdb = static_library(
'gvdb',
sources: sources,
include_directories: top_inc,
dependencies: glib_dep,
dependencies: deps,
c_args: cflags,
pic: true
)
libgvdb_dep = declare_dependency(
dependencies: deps,
link_with: libgvdb
)
......@@ -44,12 +44,13 @@ endif
add_project_arguments(common_flags, language: 'c')
gio_unix_req_version = '>= 2.25.7'
gio_req_version = '>= 2.25.7'
gio_dep = dependency('gio-2.0', version: gio_req_version)
gio_unix_dep = dependency('gio-unix-2.0', version: gio_req_version)
glib_dep = dependency('glib-2.0', version: '>= 2.44.0')
gio_unix_dep = dependency('gio-unix-2.0', version: gio_unix_req_version)
gio_module_dir = dependency('gio-2.0').get_pkgconfig_variable('giomoduledir', define_variable: ['libdir', dconf_libdir])
gio_module_dir = gio_dep.get_pkgconfig_variable('giomoduledir', define_variable: ['libdir', dconf_libdir])
dbus_session_service_dir = dependency('dbus-1').get_pkgconfig_variable('session_bus_services_dir', define_variable: ['datadir', dconf_datadir])
configure_file(
......
......@@ -28,16 +28,18 @@ sources += gnome.gdbus_codegen(
namespace: 'DConfDBus'
)
deps = [
gio_unix_dep,
libdconf_common_dep,
libdconf_shm_dep,
libgvdb_dep,
]
executable(
'dconf-service',
sources,
include_directories: top_inc,
dependencies: gio_unix_dep,
link_with: [
libdconf_common,
libdconf_shm,
libgvdb
],
dependencies: deps,
install: true,
install_dir: dconf_libexecdir
)
sources = files('dconf-shm.c')
name = meson.project_name() + '-shm'
cflags = '-DG_LOG_DOMAIN="@0@"'.format(meson.project_name())
libdconf_shm = static_library(
meson.project_name() + '-shm',
sources: sources,
name,
sources: name + '.c',
include_directories: top_inc,
dependencies: glib_dep,
c_args: cflags,
pic: true
)
libdconf_shm_dep = declare_dependency(
dependencies: glib_dep,
link_with: libdconf_shm
)
......@@ -22,14 +22,14 @@ m_dep = cc.find_library('m')
unit_tests = [
# [name, sources, c_args, dependencies, link_with]
['paths', 'paths.c', [], glib_dep, libdconf_common],
['changeset', 'changeset.c', [], glib_dep, libdconf_common],
['shm', ['shm.c', 'tmpdir.c'], [], [glib_dep, dl_dep], libdconf_shm],
['gvdb', 'gvdb.c', '-DSRCDIR="@0@"'.format(test_dir), glib_dep, libgvdb],
['gdbus-thread', 'dbus.c', '-DDBUS_BACKEND="/gdbus/thread"', gio_unix_dep, libdconf_gdbus_thread],
['gdbus-filter', 'dbus.c', '-DDBUS_BACKEND="/gdbus/filter"', gio_unix_dep, libdconf_gdbus_filter],
['engine', 'engine.c', '-DSRCDIR="@0@"'.format(test_dir), [glib_dep, dl_dep, m_dep], [libdconf_engine, libdconf_common, libdconf_mock]],
['client', 'client.c', '-DSRCDIR="@0@"'.format(test_dir), gio_unix_dep, [libdconf_client, libdconf_engine, libdconf_common, libdconf_mock]]
['paths', 'paths.c', [], libdconf_common_dep, []],
['changeset', 'changeset.c', [], libdconf_common_dep, []],
['shm', ['shm.c', 'tmpdir.c'], [], [dl_dep, libdconf_common_dep, libdconf_shm_dep], []],
['gvdb', 'gvdb.c', '-DSRCDIR="@0@"'.format(test_dir), libgvdb_dep, []],
['gdbus-thread', 'dbus.c', '-DDBUS_BACKEND="/gdbus/thread"', libdconf_gdbus_thread_dep, []],
['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]
]
foreach unit_test: unit_tests
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment