2017-11-25 11:39:06 +01:00
|
|
|
deps = [
|
|
|
|
|
dbus_dep,
|
|
|
|
|
dbus_glib_dep,
|
|
|
|
|
libnm_glib_dep,
|
2018-01-07 15:39:42 +01:00
|
|
|
libnm_util_dep,
|
|
|
|
|
shared_dep
|
2017-11-25 11:39:06 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
test_units = [
|
2018-04-11 14:30:28 +02:00
|
|
|
'test-nm-client',
|
|
|
|
|
'test-remote-settings-client'
|
2017-11-25 11:39:06 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
foreach test_unit: test_units
|
|
|
|
|
exe = executable(
|
2017-12-14 17:03:34 +01:00
|
|
|
test_unit,
|
build/meson: fix meson build for shared files
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.
2018-05-30 15:16:01 +02:00
|
|
|
[test_unit + '.c'] + shared_nm_test_utils_impl_c,
|
2017-11-25 11:39:06 +01:00
|
|
|
dependencies: deps,
|
2018-05-30 10:23:17 +02:00
|
|
|
c_args:
|
|
|
|
|
common_cflags + [
|
|
|
|
|
'-DNETWORKMANAGER_COMPILATION_TEST',
|
build: create "config-extra.h" header instead of passing directory variables via CFLAGS
1) the command line gets shorter. I frequently run `make V=1` to see
the command line arguments for the compiler, and there is a lot
of noise.
2) define each of these variables at one place. This makes it easy
to verify that for all compilation units, a particular
define has the same value. Previously that was not obvious or
even not the case (see commit e5d1a71396e107d1909744d26ad401f206c0c915
and commit d63cf1ef2faba57595112a82e962b9643cce4718).
The point is to avoid redundancy.
3) not all compilation units need all defines. In fact, most modules
would only need a few of these defines. We aimed to pass the necessary
minium of defines to each compilation unit, but that was non-obvious
to get right and often we set a define that wasn't used. See for example
"src_settings_plugins_ibft_cppflags" which needlessly had "-DSYSCONFDIR".
This question is now entirely avoided by just defining all variables in
a header. We don't care to find the minimum, because every component
gets anyway all defines from the header.
4) this also avoids the situation, where a module that previously did
not use a particular define gets modified to require it. Previously,
that would have required to identify the missing define, and add
it to the CFLAGS of the complation unit. Since every compilation
now includes "config-extra.h", all defines are available everywhere.
5) the fact that each define is now available in all compilation units
could be perceived as a downside. But it isn't, because these defines
should have a unique name and one specific value. Defining the same
name with different values, or refer to the same value by different
names is a bug, not a desirable feature. Since these defines should
be unique accross the entire tree, there is no problem in providing
them to every compilation unit.
6) the reason why we generate "config-extra.h" this way, instead of using
AC_DEFINE() in configure.ac, is due to the particular handling of
autoconf for directory variables. See [1].
With meson, it would be trivial to put them into "config.h.meson".
While that is not easy with autoconf, the "config-extra.h" workaround
seems still preferable to me.
[1] https://www.gnu.org/software/autoconf/manual/autoconf-2.63/html_node/Installation-Directory-Variables.html
2018-07-12 10:58:23 +02:00
|
|
|
],
|
2017-11-25 11:39:06 +01:00
|
|
|
)
|
|
|
|
|
|
2018-04-11 10:49:33 +02:00
|
|
|
test(
|
2018-04-11 14:47:07 +02:00
|
|
|
'libnm-glib/' + test_unit,
|
2018-04-11 10:49:33 +02:00
|
|
|
test_script,
|
|
|
|
|
args: test_args + [exe.full_path()]
|
|
|
|
|
)
|
2017-11-25 11:39:06 +01:00
|
|
|
endforeach
|