build/meson: add intermediate shared/nm-utils base library
Like also done for autotools, create and use intermediate libraries from "shared/nm-utils/". Also, replace "shared_dep" by "shared_nm_utils_base_dep". We don't need super fine-grained selection of what we link. We can always link in "shared/libnm-utils-base.a", and let the linker throw away unsed parts.
This commit is contained in:
@@ -13,7 +13,7 @@ cflags = clients_cflags + [
|
|||||||
|
|
||||||
libnmc_base = static_library(
|
libnmc_base = static_library(
|
||||||
'nmc-base',
|
'nmc-base',
|
||||||
sources: shared_files_clients_common + files(
|
sources: files(
|
||||||
'nm-client-utils.c',
|
'nm-client-utils.c',
|
||||||
'nm-secret-agent-simple.c',
|
'nm-secret-agent-simple.c',
|
||||||
'nm-vpn-helpers.c',
|
'nm-vpn-helpers.c',
|
||||||
|
@@ -140,9 +140,11 @@ libnm_core_enum = gnome.mkenums(
|
|||||||
deps = [
|
deps = [
|
||||||
dl_dep,
|
dl_dep,
|
||||||
libudev_dep,
|
libudev_dep,
|
||||||
shared_dep,
|
|
||||||
uuid_dep,
|
uuid_dep,
|
||||||
|
glib_dep,
|
||||||
shared_c_siphash_dep,
|
shared_c_siphash_dep,
|
||||||
|
shared_nm_utils_base_dep,
|
||||||
|
shared_nm_utils_udev_dep,
|
||||||
]
|
]
|
||||||
|
|
||||||
cflags = [
|
cflags = [
|
||||||
@@ -185,7 +187,6 @@ libnm_core_sources_all = libnm_core_sources
|
|||||||
libnm_core_sources_all += libnm_core_enum
|
libnm_core_sources_all += libnm_core_enum
|
||||||
libnm_core_sources_all += shared_nm_meta_setting_c
|
libnm_core_sources_all += shared_nm_meta_setting_c
|
||||||
libnm_core_sources_all += shared_nm_ethtool_utils_c
|
libnm_core_sources_all += shared_nm_ethtool_utils_c
|
||||||
libnm_core_sources_all += shared_files_libnm_core
|
|
||||||
libnm_core_sources_all += [version_header]
|
libnm_core_sources_all += [version_header]
|
||||||
|
|
||||||
libnm_core = static_library(
|
libnm_core = static_library(
|
||||||
@@ -200,7 +201,7 @@ nm_core_dep = declare_dependency(
|
|||||||
sources: libnm_core_enum[1],
|
sources: libnm_core_enum[1],
|
||||||
include_directories: libnm_core_inc,
|
include_directories: libnm_core_inc,
|
||||||
dependencies: [
|
dependencies: [
|
||||||
shared_dep,
|
shared_nm_utils_base_dep,
|
||||||
shared_c_siphash_dep,
|
shared_c_siphash_dep,
|
||||||
libnm_systemd_shared_dep,
|
libnm_systemd_shared_dep,
|
||||||
],
|
],
|
||||||
|
@@ -5,7 +5,7 @@ dbus_binding_tool = find_program('dbus-binding-tool')
|
|||||||
common_deps = [
|
common_deps = [
|
||||||
dbus_dep,
|
dbus_dep,
|
||||||
dbus_glib_dep,
|
dbus_glib_dep,
|
||||||
shared_dep,
|
shared_nm_utils_base_dep,
|
||||||
]
|
]
|
||||||
|
|
||||||
common_cflags = [
|
common_cflags = [
|
||||||
@@ -91,8 +91,6 @@ libnm_glib_vpn_enum = gnome.mkenums(
|
|||||||
install_dir: libnm_glib_pkgincludedir,
|
install_dir: libnm_glib_pkgincludedir,
|
||||||
)
|
)
|
||||||
|
|
||||||
deps = common_deps + [libnm_util_dep]
|
|
||||||
|
|
||||||
linker_script = join_paths(meson.current_source_dir(), 'libnm-glib-vpn.ver')
|
linker_script = join_paths(meson.current_source_dir(), 'libnm-glib-vpn.ver')
|
||||||
|
|
||||||
libnm_glib_vpn = shared_library(
|
libnm_glib_vpn = shared_library(
|
||||||
@@ -110,7 +108,7 @@ libnm_glib_vpn = shared_library(
|
|||||||
),
|
),
|
||||||
] + libnm_glib_vpn_enum,
|
] + libnm_glib_vpn_enum,
|
||||||
version: libnm_glib_vpn_version,
|
version: libnm_glib_vpn_version,
|
||||||
dependencies: deps,
|
dependencies: common_deps + [libnm_util_dep],
|
||||||
c_args: cflags,
|
c_args: cflags,
|
||||||
link_args: [
|
link_args: [
|
||||||
'-Wl,--version-script,@0@'.format(linker_script),
|
'-Wl,--version-script,@0@'.format(linker_script),
|
||||||
@@ -135,7 +133,7 @@ pkg.generate(
|
|||||||
variables: 'exec_prefix=${prefix}',
|
variables: 'exec_prefix=${prefix}',
|
||||||
)
|
)
|
||||||
|
|
||||||
libnm_glib_sources = shared_files_libnm_glib + files(
|
libnm_glib_sources = files(
|
||||||
'nm-access-point.c',
|
'nm-access-point.c',
|
||||||
'nm-active-connection.c',
|
'nm-active-connection.c',
|
||||||
'nm-client.c',
|
'nm-client.c',
|
||||||
@@ -189,18 +187,17 @@ libnm_glib_enum = gnome.mkenums(
|
|||||||
install_dir: libnm_glib_pkgincludedir,
|
install_dir: libnm_glib_pkgincludedir,
|
||||||
)
|
)
|
||||||
|
|
||||||
deps = common_deps + [
|
|
||||||
libnm_util_dep,
|
|
||||||
libudev_dep,
|
|
||||||
]
|
|
||||||
|
|
||||||
linker_script = join_paths(meson.current_source_dir(), 'libnm-glib.ver')
|
linker_script = join_paths(meson.current_source_dir(), 'libnm-glib.ver')
|
||||||
|
|
||||||
libnm_glib = shared_library(
|
libnm_glib = shared_library(
|
||||||
'nm-glib',
|
'nm-glib',
|
||||||
sources: libnm_glib_sources + libnm_glib_enum + [nm_secret_agent_glue],
|
sources: libnm_glib_sources + libnm_glib_enum + [nm_secret_agent_glue],
|
||||||
version: libnm_glib_version,
|
version: libnm_glib_version,
|
||||||
dependencies: deps,
|
dependencies: common_deps + [
|
||||||
|
libnm_util_dep,
|
||||||
|
libudev_dep,
|
||||||
|
shared_nm_utils_udev_dep,
|
||||||
|
],
|
||||||
c_args: cflags,
|
c_args: cflags,
|
||||||
link_whole: libdeprecated_nm_glib,
|
link_whole: libdeprecated_nm_glib,
|
||||||
link_args: [
|
link_args: [
|
||||||
@@ -229,27 +226,23 @@ pkg.generate(
|
|||||||
if enable_introspection
|
if enable_introspection
|
||||||
gir_sources = libnm_glib_sources + headers + libnm_glib_enum
|
gir_sources = libnm_glib_sources + headers + libnm_glib_enum
|
||||||
|
|
||||||
deps = [
|
|
||||||
dbus_glib_dep,
|
|
||||||
libnm_glib_dep,
|
|
||||||
libnm_util_gir_dep,
|
|
||||||
]
|
|
||||||
|
|
||||||
gir_includes = [
|
|
||||||
'DBusGLib-1.0',
|
|
||||||
'Gio-2.0',
|
|
||||||
]
|
|
||||||
|
|
||||||
libnm_glib_gir = gnome.generate_gir(
|
libnm_glib_gir = gnome.generate_gir(
|
||||||
libnm_glib,
|
libnm_glib,
|
||||||
sources: gir_sources,
|
sources: gir_sources,
|
||||||
dependencies: deps,
|
dependencies: [
|
||||||
|
dbus_glib_dep,
|
||||||
|
libnm_glib_dep,
|
||||||
|
libnm_util_gir_dep,
|
||||||
|
],
|
||||||
nsversion: nm_gir_version,
|
nsversion: nm_gir_version,
|
||||||
namespace: 'NMClient',
|
namespace: 'NMClient',
|
||||||
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_glib_name, libnm_glib_vpn_name],
|
export_packages: [libnm_glib_name, libnm_glib_vpn_name],
|
||||||
includes: gir_includes,
|
includes: [
|
||||||
|
'DBusGLib-1.0',
|
||||||
|
'Gio-2.0',
|
||||||
|
],
|
||||||
extra_args: cflags + [
|
extra_args: cflags + [
|
||||||
'--include-uninstalled=' + libnm_util_gir[0].full_path(),
|
'--include-uninstalled=' + libnm_util_gir[0].full_path(),
|
||||||
],
|
],
|
||||||
@@ -259,12 +252,10 @@ endif
|
|||||||
|
|
||||||
name = libnm_glib_name + '-test'
|
name = libnm_glib_name + '-test'
|
||||||
|
|
||||||
deps = common_deps + [libnm_util_dep]
|
|
||||||
|
|
||||||
executable(
|
executable(
|
||||||
name,
|
name,
|
||||||
name + '.c',
|
name + '.c',
|
||||||
dependencies: deps,
|
dependencies: common_deps + [libnm_util_dep],
|
||||||
c_args: cflags,
|
c_args: cflags,
|
||||||
link_with: libnm_glib,
|
link_with: libnm_glib,
|
||||||
)
|
)
|
||||||
|
@@ -3,7 +3,7 @@ deps = [
|
|||||||
dbus_glib_dep,
|
dbus_glib_dep,
|
||||||
libnm_glib_dep,
|
libnm_glib_dep,
|
||||||
libnm_util_dep,
|
libnm_util_dep,
|
||||||
shared_dep,
|
shared_nm_utils_base_dep,
|
||||||
]
|
]
|
||||||
|
|
||||||
test_units = [
|
test_units = [
|
||||||
|
@@ -89,12 +89,11 @@ sources = files(
|
|||||||
'nm-utils.c',
|
'nm-utils.c',
|
||||||
'nm-value-transforms.c',
|
'nm-value-transforms.c',
|
||||||
)
|
)
|
||||||
sources += shared_files_libnm_util
|
|
||||||
|
|
||||||
deps = [
|
deps = [
|
||||||
dbus_dep,
|
dbus_dep,
|
||||||
dbus_glib_dep,
|
dbus_glib_dep,
|
||||||
shared_dep,
|
shared_nm_utils_base_dep,
|
||||||
uuid_dep,
|
uuid_dep,
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -202,7 +201,7 @@ sources = files(
|
|||||||
)
|
)
|
||||||
|
|
||||||
deps = [
|
deps = [
|
||||||
shared_dep,
|
shared_nm_utils_base_dep,
|
||||||
]
|
]
|
||||||
|
|
||||||
libtest_crypto = static_library(
|
libtest_crypto = static_library(
|
||||||
|
@@ -2,7 +2,7 @@ deps = [
|
|||||||
dbus_dep,
|
dbus_dep,
|
||||||
dbus_glib_dep,
|
dbus_glib_dep,
|
||||||
libnm_util_dep,
|
libnm_util_dep,
|
||||||
shared_dep,
|
shared_nm_utils_base_dep,
|
||||||
]
|
]
|
||||||
|
|
||||||
cflags = common_cflags + [
|
cflags = common_cflags + [
|
||||||
|
@@ -4,7 +4,7 @@ sources = files('nm-libnm-utils.c')
|
|||||||
|
|
||||||
deps = [
|
deps = [
|
||||||
libnmdbus_dep,
|
libnmdbus_dep,
|
||||||
shared_dep,
|
shared_nm_utils_base_dep,
|
||||||
]
|
]
|
||||||
|
|
||||||
cflags = [
|
cflags = [
|
||||||
@@ -149,7 +149,7 @@ libnm_sources = files(
|
|||||||
deps = [
|
deps = [
|
||||||
dl_dep,
|
dl_dep,
|
||||||
libudev_dep,
|
libudev_dep,
|
||||||
shared_dep,
|
shared_nm_utils_base_dep,
|
||||||
uuid_dep,
|
uuid_dep,
|
||||||
libnm_systemd_shared_no_logging_dep,
|
libnm_systemd_shared_no_logging_dep,
|
||||||
]
|
]
|
||||||
|
@@ -81,37 +81,37 @@ shared_nm_test_utils_impl_c = files('nm-test-utils-impl.c')
|
|||||||
|
|
||||||
shared_nm_utils_nm_vpn_plugin_utils_c = files('nm-utils/nm-vpn-plugin-utils.c')
|
shared_nm_utils_nm_vpn_plugin_utils_c = files('nm-utils/nm-vpn-plugin-utils.c')
|
||||||
|
|
||||||
shared_files_time_utils = files('nm-utils/nm-time-utils.c')
|
###############################################################################
|
||||||
|
|
||||||
shared_files_libnm_core = files('''
|
shared_nm_utils_c_args = [
|
||||||
nm-utils/c-list-util.c
|
'-DG_LOG_DOMAIN="@0@"'.format(libnm_name),
|
||||||
nm-utils/nm-dedup-multi.c
|
'-DNETWORKMANAGER_COMPILATION=(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB)',
|
||||||
nm-utils/nm-enum-utils.c
|
]
|
||||||
nm-utils/nm-errno.c
|
|
||||||
nm-utils/nm-hash-utils.c
|
|
||||||
nm-utils/nm-io-utils.c
|
|
||||||
nm-utils/nm-random-utils.c
|
|
||||||
nm-utils/nm-secret-utils.c
|
|
||||||
nm-utils/nm-shared-utils.c
|
|
||||||
nm-utils/nm-udev-utils.c
|
|
||||||
'''.split())
|
|
||||||
|
|
||||||
shared_files_clients_common = files('''
|
shared_nm_utils_base = static_library(
|
||||||
nm-utils/nm-enum-utils.c
|
'nm-utils-base',
|
||||||
nm-utils/nm-hash-utils.c
|
sources: files('nm-utils/c-list-util.c',
|
||||||
nm-utils/nm-random-utils.c
|
'nm-utils/nm-dedup-multi.c',
|
||||||
nm-utils/nm-shared-utils.c
|
'nm-utils/nm-enum-utils.c',
|
||||||
'''.split())
|
'nm-utils/nm-errno.c',
|
||||||
|
'nm-utils/nm-hash-utils.c',
|
||||||
|
'nm-utils/nm-io-utils.c',
|
||||||
|
'nm-utils/nm-random-utils.c',
|
||||||
|
'nm-utils/nm-secret-utils.c',
|
||||||
|
'nm-utils/nm-shared-utils.c',
|
||||||
|
'nm-utils/nm-time-utils.c'),
|
||||||
|
c_args: shared_nm_utils_c_args,
|
||||||
|
include_directories: [
|
||||||
|
top_inc,
|
||||||
|
shared_inc,
|
||||||
|
],
|
||||||
|
dependencies: [
|
||||||
|
glib_dep,
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
shared_files_libnm_util = files('''
|
shared_nm_utils_base_dep = declare_dependency(
|
||||||
nm-utils/nm-shared-utils.c
|
link_with: shared_nm_utils_base,
|
||||||
'''.split())
|
|
||||||
|
|
||||||
shared_files_libnm_glib = files('''
|
|
||||||
nm-utils/nm-udev-utils.c
|
|
||||||
'''.split())
|
|
||||||
|
|
||||||
shared_dep = declare_dependency(
|
|
||||||
include_directories: [
|
include_directories: [
|
||||||
top_inc,
|
top_inc,
|
||||||
shared_inc,
|
shared_inc,
|
||||||
@@ -119,26 +119,44 @@ shared_dep = declare_dependency(
|
|||||||
dependencies: glib_dep,
|
dependencies: glib_dep,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
shared_nm_utils_udev = static_library(
|
||||||
|
'nm-utils-udev',
|
||||||
|
sources: files('nm-utils/nm-udev-utils.c'),
|
||||||
|
c_args: shared_nm_utils_c_args,
|
||||||
|
include_directories: [
|
||||||
|
top_inc,
|
||||||
|
shared_inc,
|
||||||
|
],
|
||||||
|
dependencies: [
|
||||||
|
glib_dep,
|
||||||
|
shared_nm_utils_base_dep,
|
||||||
|
libudev_dep,
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
shared_nm_utils_udev_dep = declare_dependency(
|
||||||
|
link_with: shared_nm_utils_udev,
|
||||||
|
include_directories: [
|
||||||
|
top_inc,
|
||||||
|
shared_inc,
|
||||||
|
],
|
||||||
|
dependencies: [
|
||||||
|
glib_dep,
|
||||||
|
shared_nm_utils_base_dep,
|
||||||
|
libudev_dep,
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
test_shared_general = executable(
|
test_shared_general = executable(
|
||||||
'nm-utils/tests/test-shared-general',
|
'nm-utils/tests/test-shared-general',
|
||||||
[ 'nm-utils/tests/test-shared-general.c',
|
[ 'nm-utils/tests/test-shared-general.c', ],
|
||||||
'nm-utils/c-list-util.c',
|
|
||||||
'nm-utils/nm-dedup-multi.c',
|
|
||||||
'nm-utils/nm-enum-utils.c',
|
|
||||||
'nm-utils/nm-hash-utils.c',
|
|
||||||
'nm-utils/nm-io-utils.c',
|
|
||||||
'nm-utils/nm-random-utils.c',
|
|
||||||
'nm-utils/nm-secret-utils.c',
|
|
||||||
'nm-utils/nm-shared-utils.c',
|
|
||||||
'nm-utils/nm-time-utils.c',
|
|
||||||
],
|
|
||||||
c_args: [
|
c_args: [
|
||||||
'-DNETWORKMANAGER_COMPILATION_TEST',
|
'-DNETWORKMANAGER_COMPILATION_TEST',
|
||||||
'-DNETWORKMANAGER_COMPILATION=(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG)',
|
'-DNETWORKMANAGER_COMPILATION=(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG)',
|
||||||
],
|
],
|
||||||
dependencies: shared_dep,
|
dependencies: shared_nm_utils_base_dep,
|
||||||
link_with: shared_c_siphash,
|
link_with: shared_c_siphash,
|
||||||
)
|
)
|
||||||
test(
|
test(
|
||||||
@@ -188,7 +206,7 @@ libnm_systemd_shared = static_library(
|
|||||||
'systemd/sd-adapt-shared',
|
'systemd/sd-adapt-shared',
|
||||||
'systemd/src/basic',
|
'systemd/src/basic',
|
||||||
),
|
),
|
||||||
dependencies: shared_dep,
|
dependencies: shared_nm_utils_base_dep,
|
||||||
c_args: [
|
c_args: [
|
||||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_SYSTEMD_SHARED',
|
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_SYSTEMD_SHARED',
|
||||||
'-DG_LOG_DOMAIN="libnm"',
|
'-DG_LOG_DOMAIN="libnm"',
|
||||||
@@ -201,7 +219,7 @@ libnm_systemd_shared_dep = declare_dependency(
|
|||||||
'systemd/src/basic',
|
'systemd/src/basic',
|
||||||
),
|
),
|
||||||
dependencies: [
|
dependencies: [
|
||||||
shared_dep,
|
shared_nm_utils_base_dep,
|
||||||
],
|
],
|
||||||
link_with: [
|
link_with: [
|
||||||
libnm_systemd_shared,
|
libnm_systemd_shared,
|
||||||
@@ -217,7 +235,7 @@ libnm_systemd_logging_stub = static_library(
|
|||||||
'systemd/sd-adapt-shared',
|
'systemd/sd-adapt-shared',
|
||||||
'systemd/src/basic',
|
'systemd/src/basic',
|
||||||
),
|
),
|
||||||
dependencies: shared_dep,
|
dependencies: shared_nm_utils_base_dep,
|
||||||
c_args: [
|
c_args: [
|
||||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_SYSTEMD_SHARED',
|
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_SYSTEMD_SHARED',
|
||||||
'-DG_LOG_DOMAIN="libnm"',
|
'-DG_LOG_DOMAIN="libnm"',
|
||||||
|
@@ -45,8 +45,6 @@ sources = files(
|
|||||||
'nm-logging.c',
|
'nm-logging.c',
|
||||||
)
|
)
|
||||||
|
|
||||||
sources += shared_files_time_utils
|
|
||||||
|
|
||||||
deps = [
|
deps = [
|
||||||
libsystemd_dep,
|
libsystemd_dep,
|
||||||
libudev_dep,
|
libudev_dep,
|
||||||
|
Reference in New Issue
Block a user