meson: Improve targets involving libnm library
The targets that involve the use of the `libnm` library have been improved by applying a set of changes: - Generated enum sources variable `libnm_enum` has been renamed to `libnm_enum_sources` to clearly specify what it is holding. - Indentation in the `libnm` build and test files has been fixed. - Set of objects used in targets have been grouped together.
This commit is contained in:

committed by
Thomas Haller

parent
1cd615288e
commit
caf470f788
@@ -23,7 +23,7 @@ sources = files(
|
|||||||
|
|
||||||
libnmt_newt = static_library(
|
libnmt_newt = static_library(
|
||||||
'nmt-newt',
|
'nmt-newt',
|
||||||
sources: sources + [libnm_enum[1]],
|
sources: sources + [libnm_enum_sources[1]],
|
||||||
include_directories: libnm_inc,
|
include_directories: libnm_inc,
|
||||||
dependencies: deps,
|
dependencies: deps,
|
||||||
c_args: cflags,
|
c_args: cflags,
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
examples = [
|
examples = [
|
||||||
['add-connection-gdbus', [libnm_enum[1]], [uuid_dep]],
|
['add-connection-gdbus', [libnm_enum_sources[1]], [uuid_dep]],
|
||||||
['add-connection-libnm', [], [libnm_dep]],
|
['add-connection-libnm', [], [libnm_dep]],
|
||||||
['get-active-connections-gdbus', [libnm_enum[1]], []],
|
['get-active-connections-gdbus', [libnm_enum_sources[1]], []],
|
||||||
['get-ap-info-libnm', [], [libnm_dep]],
|
['get-ap-info-libnm', [], [libnm_dep]],
|
||||||
['list-connections-gdbus', [], []],
|
['list-connections-gdbus', [], []],
|
||||||
['list-connections-libnm', [], [libnm_dep]],
|
['list-connections-libnm', [], [libnm_dep]],
|
||||||
|
@@ -6,7 +6,7 @@ libnm_nm_default_dep = declare_dependency(
|
|||||||
dependencies: libnm_core_nm_default_dep,
|
dependencies: libnm_core_nm_default_dep,
|
||||||
)
|
)
|
||||||
|
|
||||||
cflags = [
|
c_flags = [
|
||||||
'-DG_LOG_DOMAIN="@0@"'.format(libnm_name),
|
'-DG_LOG_DOMAIN="@0@"'.format(libnm_name),
|
||||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM',
|
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM',
|
||||||
]
|
]
|
||||||
@@ -65,12 +65,11 @@ install_headers(
|
|||||||
subdir: libnm_name,
|
subdir: libnm_name,
|
||||||
)
|
)
|
||||||
|
|
||||||
enum_headers = libnm_headers + [nm_version_macro_header]
|
|
||||||
enum_types = 'nm-enum-types'
|
enum_types = 'nm-enum-types'
|
||||||
|
|
||||||
libnm_enum = gnome.mkenums(
|
libnm_enum_sources = gnome.mkenums(
|
||||||
enum_types,
|
enum_types,
|
||||||
sources: enum_headers,
|
sources: libnm_headers + [nm_version_macro_header],
|
||||||
identifier_prefix: nm_id_prefix,
|
identifier_prefix: nm_id_prefix,
|
||||||
c_template: enum_types + '.c.template',
|
c_template: enum_types + '.c.template',
|
||||||
h_template: enum_types + '.h.template',
|
h_template: enum_types + '.h.template',
|
||||||
@@ -133,48 +132,50 @@ libnm_sources = files(
|
|||||||
'nm-wimax-nsp.c',
|
'nm-wimax-nsp.c',
|
||||||
)
|
)
|
||||||
|
|
||||||
linker_script = join_paths(meson.current_source_dir(), 'libnm.ver')
|
deps = [
|
||||||
|
libnmdbus_dep,
|
||||||
|
libnm_nm_default_dep,
|
||||||
|
libnm_udev_aux_dep,
|
||||||
|
libudev_dep,
|
||||||
|
]
|
||||||
|
|
||||||
|
links = [
|
||||||
|
libnm_libnm_core_intern,
|
||||||
|
libnm_systemd_logging_stub,
|
||||||
|
]
|
||||||
|
|
||||||
liblibnm = static_library(
|
liblibnm = static_library(
|
||||||
'libnm',
|
'libnm',
|
||||||
sources: libnm_sources + libnm_enum,
|
sources: libnm_sources + libnm_enum_sources,
|
||||||
include_directories: libnm_core_inc,
|
include_directories: libnm_core_inc,
|
||||||
dependencies: [
|
dependencies: deps,
|
||||||
libnmdbus_dep,
|
c_args: c_flags,
|
||||||
dl_dep,
|
link_with: links,
|
||||||
libudev_dep,
|
|
||||||
libnm_nm_default_dep,
|
|
||||||
libnm_udev_aux_dep,
|
|
||||||
uuid_dep,
|
|
||||||
],
|
|
||||||
c_args: cflags,
|
|
||||||
link_with: [libnm_systemd_logging_stub, libnm_libnm_core_intern],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
links = [
|
||||||
|
liblibnm,
|
||||||
|
libnm_core,
|
||||||
|
libnmdbus,
|
||||||
|
libnm_systemd_logging_stub,
|
||||||
|
libnm_utils_base,
|
||||||
|
]
|
||||||
|
|
||||||
|
linker_script = join_paths(meson.current_source_dir(), 'libnm.ver')
|
||||||
|
|
||||||
libnm = shared_library(
|
libnm = shared_library(
|
||||||
'nm',
|
'nm',
|
||||||
version: libnm_version,
|
version: libnm_version,
|
||||||
dependencies: libnm_nm_default_dep,
|
dependencies: libnm_nm_default_dep,
|
||||||
link_whole: [
|
link_whole: links,
|
||||||
liblibnm,
|
link_args: '-Wl,--version-script,@0@'.format(linker_script),
|
||||||
libnm_core,
|
|
||||||
libnm_systemd_logging_stub,
|
|
||||||
libnmdbus,
|
|
||||||
libnm_utils_base,
|
|
||||||
],
|
|
||||||
link_args: [
|
|
||||||
'-Wl,--version-script,@0@'.format(linker_script),
|
|
||||||
],
|
|
||||||
link_depends: linker_script,
|
link_depends: linker_script,
|
||||||
install: true,
|
install: true,
|
||||||
)
|
)
|
||||||
|
|
||||||
libnm_dep = declare_dependency(
|
libnm_dep = declare_dependency(
|
||||||
sources: libnm_enum[1],
|
sources: libnm_enum_sources[1],
|
||||||
include_directories: [
|
include_directories: libnm_inc,
|
||||||
libnm_inc,
|
|
||||||
libnm_core_inc,
|
|
||||||
],
|
|
||||||
link_with: libnm,
|
link_with: libnm,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -199,21 +200,19 @@ test(
|
|||||||
)
|
)
|
||||||
|
|
||||||
if enable_introspection
|
if enable_introspection
|
||||||
gir_sources = libnm_core_enum_sources + libnm_core_headers + libnm_core_sources + libnm_enum + libnm_headers + libnm_sources + [nm_version_macro_header]
|
|
||||||
|
|
||||||
libnm_gir = gnome.generate_gir(
|
libnm_gir = gnome.generate_gir(
|
||||||
libnm,
|
libnm,
|
||||||
sources: gir_sources,
|
sources: libnm_core_sources + libnm_core_headers + libnm_core_enum_sources + libnm_sources + libnm_headers + libnm_enum_sources + [nm_version_macro_header],
|
||||||
|
includes: 'Gio-2.0',
|
||||||
nsversion: nm_gir_version,
|
nsversion: nm_gir_version,
|
||||||
namespace: 'NM',
|
namespace: 'NM',
|
||||||
identifier_prefix: nm_id_prefix,
|
identifier_prefix: nm_id_prefix,
|
||||||
symbol_prefix: nm_id_prefix.to_lower(),
|
symbol_prefix: nm_id_prefix.to_lower(),
|
||||||
export_packages: libnm_name,
|
|
||||||
includes: 'Gio-2.0',
|
|
||||||
extra_args: cflags,
|
|
||||||
header: 'NetworkManager.h',
|
header: 'NetworkManager.h',
|
||||||
|
export_packages: libnm_name,
|
||||||
|
extra_args: c_flags,
|
||||||
install: true,
|
install: true,
|
||||||
dependencies: libnm_dep,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
generate_plugin_docs = join_paths(meson.current_source_dir(), 'generate-plugin-docs.pl')
|
generate_plugin_docs = join_paths(meson.current_source_dir(), 'generate-plugin-docs.pl')
|
||||||
@@ -276,9 +275,9 @@ if enable_introspection
|
|||||||
name = 'nm-settings-docs.xml'
|
name = 'nm-settings-docs.xml'
|
||||||
nm_settings_docs = custom_target(
|
nm_settings_docs = custom_target(
|
||||||
name,
|
name,
|
||||||
input: libnm_gir[0],
|
input: [libnm_gir[0], nm_settings_docs_overrides],
|
||||||
output: name,
|
output: name,
|
||||||
command: [generate_setting_docs_env, python.path(), generate_setting_docs, '--lib-path', meson.current_build_dir(), '--gir', '@INPUT@', '--overrides', nm_settings_docs_overrides, '--output', '@OUTPUT@'],
|
command: [generate_setting_docs_env, python.path(), generate_setting_docs, '--lib-path', meson.current_build_dir(), '--gir', '@INPUT0@', '--overrides', '@INPUT1@', '--output', '@OUTPUT@'],
|
||||||
depends: libnm_gir,
|
depends: libnm_gir,
|
||||||
)
|
)
|
||||||
endif
|
endif
|
||||||
|
@@ -10,7 +10,7 @@ deps = [
|
|||||||
libnm_nm_default_dep,
|
libnm_nm_default_dep,
|
||||||
]
|
]
|
||||||
|
|
||||||
cflags = [
|
c_flags = [
|
||||||
'-DNETWORKMANAGER_COMPILATION_TEST',
|
'-DNETWORKMANAGER_COMPILATION_TEST',
|
||||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM',
|
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM',
|
||||||
]
|
]
|
||||||
@@ -18,13 +18,9 @@ cflags = [
|
|||||||
foreach test_unit: test_units
|
foreach test_unit: test_units
|
||||||
exe = executable(
|
exe = executable(
|
||||||
test_unit[0],
|
test_unit[0],
|
||||||
[
|
[test_unit[0] + '.c', nm_test_utils_impl_source, libnm_enum_sources[1]],
|
||||||
test_unit[0] + '.c',
|
|
||||||
nm_test_utils_impl_source,
|
|
||||||
libnm_enum[1],
|
|
||||||
],
|
|
||||||
dependencies: deps,
|
dependencies: deps,
|
||||||
c_args: cflags,
|
c_args: c_flags,
|
||||||
link_with: liblibnm,
|
link_with: liblibnm,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -39,8 +35,8 @@ endforeach
|
|||||||
# just test, that we can build "nm-vpn-plugin-utils.c"
|
# just test, that we can build "nm-vpn-plugin-utils.c"
|
||||||
libnm_vpn_plugin_utils_test = static_library(
|
libnm_vpn_plugin_utils_test = static_library(
|
||||||
'nm-vpn-plugin-utils-test',
|
'nm-vpn-plugin-utils-test',
|
||||||
sources: nm_vpn_plugin_utils_source + [libnm_enum[1]],
|
sources: nm_vpn_plugin_utils_source + [libnm_enum_sources[1]],
|
||||||
include_directories: libnm_inc,
|
include_directories: libnm_inc,
|
||||||
dependencies: libnm_nm_default_dep,
|
dependencies: libnm_nm_default_dep,
|
||||||
c_args: cflags,
|
c_args: c_flags,
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user