Files
NetworkManager/clients/common/meson.build
Thomas Haller b13a2b27e9 all: move shared/nm-meta-setting.[hc] to libnm-core and clients
"shared/nm-meta-setting.[hc]" contains meta data about settings.
As such it is similarly used by libnm-core (as internal API) and
by clients (as extension of public API of libnm). However, it must
be compiled twice, because while it defines in both cases a
NMMetaSettingInfo type, these types are different between internal and
public API.
Hence, the files must also be compiled twice (and differently), once
against libnm-core and once against the client helper library.

Previously, the file was under "shared/", but there it's a bit odd
it doesn't clearly belong anywhere.

There are two goals here:

 - copy the file to the two places where it is used. We also have
   a "check-tree" unit test that ensures those files don't diverge in
   the future.

 - we no longer require CFLAGS set during built. Instead, the sources
   should control the build. For that we have new (simple) headers
   "nm-meta-setting-base.h" that define the right behavior for the
   impl files.

There is still an ugliness (among several): the files must be named the
same for libnm-core and clients/common. Preferably, all our sources have
unique names, but that is not possible with this scheme (without
introducing other ugliness). To mitigate that, include the files only at
one exact place.
2021-02-09 12:38:19 +01:00

92 lines
1.8 KiB
Meson

# SPDX-License-Identifier: LGPL-2.1-or-later
common_inc = include_directories('.')
libnmc_base = static_library(
'nmc-base',
sources: files(
'nm-client-utils.c',
'nm-secret-agent-simple.c',
'nm-vpn-helpers.c',
'nm-polkit-listener.c',
),
dependencies: [
libnm_dep,
libnm_nm_default_dep,
],
c_args: [
'-DG_LOG_DOMAIN="libnmc"',
],
)
libnmc_base_dep = declare_dependency(
include_directories: common_inc,
dependencies: [
libnm_dep,
libnm_nm_default_dep,
],
link_with: libnmc_base,
)
if enable_docs
settings_docs_source = custom_target(
'settings-docs.h',
input: nm_settings_docs_xml_gir,
output: 'settings-docs.h',
command: [
xsltproc,
'--output',
'@OUTPUT@',
join_paths(meson.current_source_dir(), 'settings-docs.xsl'),
'@INPUT@',
],
)
test(
'check-settings-docs',
find_program(join_paths(source_root, 'tools', 'check-compare-generated.sh')),
args: [
source_root,
build_root,
'clients/common/settings-docs.h',
],
)
else
settings_docs_source = configure_file(
input: 'settings-docs.h.in',
output: '@BASENAME@',
configuration: configuration_data(),
)
endif
libnmc = static_library(
'nmc',
sources: [settings_docs_source] + files(
'nm-meta-setting-access.c',
'nm-meta-setting-base-impl.c',
'nm-meta-setting-desc.c',
),
dependencies: [
libnm_dep,
libnm_nm_default_dep,
libnm_libnm_core_aux_dep,
],
c_args: [
'-DG_LOG_DOMAIN="libnmc"',
],
link_depends: settings_docs_source,
)
libnmc_dep = declare_dependency(
include_directories: common_inc,
dependencies: [
libnm_dep,
libnm_nm_default_dep,
],
link_with: libnmc,
)
if (enable_introspection or enable_nmtui) and enable_tests
subdir('tests')
endif