diff options
author | Iñigo Martínez <inigomartinez@gmail.com> | 2018-01-07 15:39:42 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-01-10 12:20:17 +0100 |
commit | 5e16bcf268b0a88764c06ecdb0d694cff560d201 (patch) | |
tree | 53adb3607e52fc64e0fbaa821c145f00ad6a8dbd /libnm-glib | |
parent | 96658d2fd11410b01d11ace62a89899dd7958ee4 (diff) |
meson: Improve dependency system
Some targets are missing dependencies on some generated sources in
the meson port. These makes the build to fail due to missing source
files on a highly parallelized build.
These dependencies have been resolved by taking advantage of meson's
internal dependencies which can be used to pass source files,
include directories, libraries and compiler flags.
One of such internal dependencies called `core_dep` was already in
use. However, in order to avoid any confusion with another new
internal dependency called `nm_core_dep`, which is used to include
directories and source files from the `libnm-core` directory, the
`core_dep` dependency has been renamed to `nm_dep`.
These changes have allowed minimizing the build details which are
inherited by using those dependencies. The parallelized build has
also been improved.
Diffstat (limited to 'libnm-glib')
-rw-r--r-- | libnm-glib/meson.build | 38 | ||||
-rw-r--r-- | libnm-glib/tests/meson.build | 12 |
2 files changed, 17 insertions, 33 deletions
diff --git a/libnm-glib/meson.build b/libnm-glib/meson.build index 727c8b39c..4c3f23cc1 100644 --- a/libnm-glib/meson.build +++ b/libnm-glib/meson.build @@ -1,14 +1,11 @@ -dbus_binding_tool = find_program('dbus-binding-tool') +libnm_glib_inc = include_directories('.') -common_incs = [ - top_inc, - shared_inc -] +dbus_binding_tool = find_program('dbus-binding-tool') common_deps = [ dbus_dep, dbus_glib_dep, - glib_dep + shared_dep ] common_cflags = [ @@ -16,11 +13,9 @@ common_cflags = [ ] cflags = common_cflags + [ - '-DG_LOG_DOMAIN="libnm-glib"', + '-DG_LOG_DOMAIN="libnm-glib"' ] -libnm_glib_inc = include_directories('.') - vpn_headers = files( 'nm-vpn-plugin.h', 'nm-vpn-plugin-ui-interface.h', @@ -65,12 +60,10 @@ install_headers( subdir: 'libnm-glib' ) -incs = common_incs + [libnm_util_inc] - libdeprecated_nm_glib = static_library( 'deprecated-nm-glib', sources: 'libnm_glib.c', - include_directories: incs, + include_directories: libnm_util_inc, dependencies: common_deps, c_args: cflags + [ '-Wno-deprecated-declarations', @@ -116,9 +109,8 @@ endif libnm_glib_vpn = shared_library( 'nm-glib-vpn', - sources: sources + libnm_glib_vpn_enum + [libnm_utils_enum[1]], + sources: sources + libnm_glib_vpn_enum, version: libnm_glib_vpn_version, - include_directories: common_incs, dependencies: deps, c_args: cflags, link_args: ldflags, @@ -127,8 +119,8 @@ libnm_glib_vpn = shared_library( ) libnm_glib_vpn_dep = declare_dependency( - link_with: libnm_glib_vpn, - include_directories: libnm_glib_inc + include_directories: libnm_glib_inc, + link_with: libnm_glib_vpn ) pkg.generate( @@ -197,8 +189,8 @@ libnm_glib_enum = gnome.mkenums( ) deps = common_deps + [ - libudev_dep, - libnm_util_dep + libnm_util_dep, + libudev_dep ] symbol_map = join_paths(meson.current_source_dir(), 'libnm-glib.ver') @@ -210,9 +202,8 @@ endif libnm_glib = shared_library( 'nm-glib', - sources: sources + libnm_glib_enum + [nm_secret_agent_glue, libnm_utils_enum[1]], + sources: sources + libnm_glib_enum + [nm_secret_agent_glue], version: libnm_glib_version, - include_directories: common_incs, dependencies: deps, c_args: cflags + [ '-DNMRUNDIR="@0@"'.format(nm_pkgrundir), @@ -224,8 +215,8 @@ libnm_glib = shared_library( ) libnm_glib_dep = declare_dependency( - link_with: libnm_glib, - include_directories: libnm_glib_inc + include_directories: libnm_glib_inc, + link_with: libnm_glib ) pkg.generate( @@ -276,8 +267,7 @@ deps = common_deps + [libnm_util_dep] executable( name, - [name + '.c', libnm_utils_enum[1]], - include_directories: common_incs, + name + '.c', dependencies: deps, c_args: cflags, link_with: libnm_glib diff --git a/libnm-glib/tests/meson.build b/libnm-glib/tests/meson.build index eb12dfe36..2ab17039e 100644 --- a/libnm-glib/tests/meson.build +++ b/libnm-glib/tests/meson.build @@ -1,14 +1,9 @@ -incs = [ - top_inc, - shared_inc -] - deps = [ dbus_dep, dbus_glib_dep, - glib_dep, libnm_glib_dep, - libnm_util_dep + libnm_util_dep, + shared_dep ] test_units = [ @@ -19,8 +14,7 @@ test_units = [ foreach test_unit: test_units exe = executable( test_unit, - [test_unit + '.c', libnm_utils_enum[1]] + shared_test_utils, - include_directories: incs, + [test_unit + '.c'] + shared_test_utils, dependencies: deps, c_args: common_cflags + [ '-DNETWORKMANAGER_COMPILATION_TEST', |