Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx> --- tests/Makefile.am | 20 -------------------- tests/meson.build | 17 +++++++++++++++++ tools/nss/meson.build | 2 ++ 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index a8a3996bab1..816d7ec8a64 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -96,7 +96,6 @@ endif WITH_STORAGE_FS if WITH_NSS test_helpers += nsslinktest nssguestlinktest -test_programs += nsstest nssguesttest endif WITH_NSS test_scripts = @@ -440,25 +439,6 @@ viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \ endif WITH_SELINUX if WITH_NSS -nsstest_SOURCES = \ - nsstest.c testutils.h testutils.c -nsstest_CFLAGS = \ - $(AM_CFLAGS) \ - -I$(top_srcdir)/tools/nss -nsstest_LDADD = \ - $(LDADDS) \ - ../tools/nss/libnss_libvirt_impl.la - -nssguesttest_SOURCES = \ - nsstest.c testutils.h testutils.c -nssguesttest_CFLAGS = \ - -DLIBVIRT_NSS_GUEST \ - $(AM_CFLAGS) \ - -I$(top_srcdir)/tools/nss -nssguesttest_LDADD = \ - $(LDADDS) \ - ../tools/nss/libnss_libvirt_guest_impl.la - ## Intentionaly not linking with anything else. ## See the test source for more detailed explanation. nsslinktest_SOURCES = nsslinktest.c diff --git a/tests/meson.build b/tests/meson.build index e8154810b05..0b503bca720 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -400,6 +400,23 @@ if conf.has('WITH_NODE_DEVICES') ] endif +if conf.has('WITH_NSS') + tests += [ + { + 'name': 'nsstest', + 'include': [ nss_inc_dir ], + 'link_with': [ nss_libvirt_impl ], + }, + { + 'name': 'nssguesttest', + 'sources': [ 'nsstest.c' ], + 'c_args': [ '-DLIBVIRT_NSS_GUEST' ], + 'include': [ nss_inc_dir ], + 'link_with': [ nss_libvirt_guest_impl ], + }, + ] +endif + foreach data : tests test_sources = '@0@.c'.format(data['name']) test_bin = executable( diff --git a/tools/nss/meson.build b/tools/nss/meson.build index b07bfa4be8b..cf3eec9b24a 100644 --- a/tools/nss/meson.build +++ b/tools/nss/meson.build @@ -88,3 +88,5 @@ nss_libvirt_guest_lib = shared_library( install: true, install_dir: libdir, ) + +nss_inc_dir = include_directories('.') -- 2.26.2