From 052734a8d36adec56e6f9a67df2a2c14d1d18bdb Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 6 Feb 2019 12:48:58 +0100 Subject: [PATCH] build/meson: cleanup of libnm/meson.build "libnm/fake-typelib/meson.build" modifies the variable "sources", which is defined by the outer "libnm/meson.build" file. That is confusing. If a variable is not only used within one "meson.build" file alone, it should have a unique name. Rename the variable to "libnm_utils_sources". Also avoid local variable "deps" which is only used at one place. --- libnm/fake-typelib/meson.build | 2 +- libnm/meson.build | 32 +++++++++++++++----------------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/libnm/fake-typelib/meson.build b/libnm/fake-typelib/meson.build index cafe013ada..fdbb29202e 100644 --- a/libnm/fake-typelib/meson.build +++ b/libnm/fake-typelib/meson.build @@ -20,7 +20,7 @@ endforeach resource = 'typelibs' -sources += gnome.compile_resources( +libnm_utils_sources += gnome.compile_resources( resource, resource + '.gresource.xml', source_dir: '.', diff --git a/libnm/meson.build b/libnm/meson.build index 8fcc2cdeb9..e61e20f66e 100644 --- a/libnm/meson.build +++ b/libnm/meson.build @@ -1,17 +1,17 @@ libnm_inc = include_directories('.') -sources = files('nm-libnm-utils.c') - -deps = [ - libnmdbus_dep, - shared_nm_utils_base_dep, -] - cflags = [ '-DG_LOG_DOMAIN="@0@"'.format(libnm_name), '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM', ] +libnm_utils_sources = files('nm-libnm-utils.c') + +deps = [ + libnmdbus_dep, + shared_nm_utils_base_dep, +] + if have_fake_typelibs deps += gir_dep subdir('fake-typelib') @@ -19,7 +19,7 @@ endif libnm_utils = static_library( 'nm-utils', - sources: sources, + sources: libnm_utils_sources, include_directories: libnm_core_inc, dependencies: deps, c_args: cflags, @@ -146,14 +146,6 @@ libnm_sources = files( 'nm-wimax-nsp.c', ) -deps = [ - dl_dep, - libudev_dep, - shared_nm_utils_base_dep, - uuid_dep, - libnm_systemd_shared_no_logging_dep, -] - linker_script = join_paths(meson.current_source_dir(), 'libnm.ver') @@ -162,7 +154,13 @@ libnm = shared_library( sources: libnm_sources + libnm_enum, version: libnm_version, include_directories: libnm_core_inc, - dependencies: deps, + dependencies: [ + dl_dep, + libudev_dep, + shared_nm_utils_base_dep, + uuid_dep, + libnm_systemd_shared_no_logging_dep, + ], c_args: cflags, link_with: libnm_utils, link_whole: libnm_core,