mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-06 16:40:16 +01:00
The files in shared/nm-utils are not compiled as one static library,
instead each subproject that needs (parts of) them, re-compiles the
files individually.
The major reason for that is, because we might have different compile
flags, depending on whether we build libnm-core or
libnm-util/libnm-glib. Actually, I think that is not really the case,
and maybe this should be refactored, to indeed build them all as a
static library first.
Anyway, libnm-util, libnm-glib, clients' common lib, they all need a
different set of shared files that they should compile. Refactor
"shared/meson.build" to account for that and handle it like autotools
does.
Another change is, that "shared_c_siphash_dep" no longer advertises
"include_directories: include_directories('c-siphash/src')". We don't
put c-siphash.h into the include search path. Users who need it, should
include it via "#include <c-siphash/src/c-siphash.h>". The only exception
is when building shared_n_acd library, which is not under our control.
76 lines
1.9 KiB
Meson
76 lines
1.9 KiB
Meson
common_inc = include_directories('.')
|
|
|
|
nm_polkit_listener = files('nm-polkit-listener.c')
|
|
|
|
deps = [
|
|
libnm_dep,
|
|
nm_core_dep
|
|
]
|
|
|
|
cflags = clients_cflags + [
|
|
'-DG_LOG_DOMAIN="libnmc"',
|
|
]
|
|
|
|
libnmc_base = static_library(
|
|
'nmc-base',
|
|
sources: shared_files_clients_common + files(
|
|
'nm-client-utils.c',
|
|
'nm-secret-agent-simple.c',
|
|
'nm-vpn-helpers.c',
|
|
),
|
|
dependencies: deps,
|
|
c_args: cflags
|
|
)
|
|
|
|
libnmc_base_dep = declare_dependency(
|
|
include_directories: common_inc,
|
|
link_with: libnmc_base
|
|
)
|
|
|
|
settings_docs = 'settings-docs.h'
|
|
|
|
if enable_introspection
|
|
settings_docs_source = custom_target(
|
|
settings_docs,
|
|
input: nm_property_docs,
|
|
output: settings_docs,
|
|
command: [xsltproc, '--output', '@OUTPUT@', join_paths(meson.current_source_dir(), 'settings-docs.xsl'), '@INPUT@']
|
|
)
|
|
|
|
# FIXME: if enabled the check happens even if the settings_docs_source is not set
|
|
'''
|
|
if get_option('check_settings_docs')
|
|
res = run_command(find_program('cmp'), '-s', settings_docs + '.in', settings_docs_source.full_path())
|
|
if res.returncode() != 0
|
|
message('The generated file ' + settings_docs_source.full_path() + ' differs from the source file ' + settings_docs + '.in' + '. You probably should copy the generated file over to the source file. You can skip this test by setting -Dcheck_settings_docs=false')
|
|
endif
|
|
endif
|
|
'''
|
|
else
|
|
settings_docs_source = configure_file(
|
|
input: settings_docs + '.in',
|
|
output: settings_docs,
|
|
configuration: configuration_data()
|
|
)
|
|
endif
|
|
|
|
libnmc = static_library(
|
|
'nmc',
|
|
sources: files(
|
|
'nm-meta-setting-access.c',
|
|
'nm-meta-setting-desc.c'
|
|
) + shared_nm_utils_nm_meta_setting_c + [settings_docs_source],
|
|
dependencies: deps,
|
|
c_args: cflags,
|
|
link_with: libnmc_base,
|
|
link_depends: settings_docs_source
|
|
)
|
|
|
|
libnmc_dep = declare_dependency(
|
|
include_directories: common_inc,
|
|
link_with: libnmc
|
|
)
|
|
|
|
if (enable_introspection or enable_nmtui) and enable_tests
|
|
subdir('tests')
|
|
endif
|