diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2018-09-19 13:34:55 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2018-09-19 16:03:32 +0200 |
commit | 470c5c0a82a546b9dd294693f8aba0f11a51048f (patch) | |
tree | 42c7af2d2d25ba11849b05b9c4ffe4360186ba55 /src/initrd | |
parent | 5af7d46be49b581319e92296931f30af714d3c6d (diff) | |
download | NetworkManager-470c5c0a82a546b9dd294693f8aba0f11a51048f.tar.gz |
initrd: enable meson builds
Diffstat (limited to 'src/initrd')
-rw-r--r-- | src/initrd/meson.build | 32 | ||||
-rw-r--r-- | src/initrd/tests/meson.build | 37 |
2 files changed, 51 insertions, 18 deletions
diff --git a/src/initrd/meson.build b/src/initrd/meson.build new file mode 100644 index 0000000000..66e825d535 --- /dev/null +++ b/src/initrd/meson.build @@ -0,0 +1,32 @@ +sources = files( + 'nmi-cmdline-reader.c', + 'nmi-ibft-reader.c' +) + +nm_cflags = ['-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON'] + +libnmi_core = static_library( + 'nmi-core', + c_args: nm_cflags, + sources: sources, + include_directories: src_inc, + dependencies: nm_core_dep, +) + +name = 'nm-initrd-generator' +executable( + name, + name + '.c', + c_args: nm_cflags, + include_directories: src_inc, + dependencies: [ nm_core_dep ], + link_with: [libnetwork_manager_base, libnmi_core], + link_args: ldflags_linker_script_binary, + link_depends: linker_script_binary, + install: true, + install_dir: nm_libexecdir, +) + +if enable_tests + subdir('tests') +endif diff --git a/src/initrd/tests/meson.build b/src/initrd/tests/meson.build index 0e74ea8d9e..6b316d4ed4 100644 --- a/src/initrd/tests/meson.build +++ b/src/initrd/tests/meson.build @@ -1,22 +1,23 @@ -test_unit = 'test-ibft' - -test_ibft_dir = meson.current_source_dir() +test_units = [ + 'test-ibft-reader', + 'test-cmdline-reader', +] cflags = [ - '-DTEST_IBFT_DIR="@0@"'.format(test_ibft_dir), - '-DTEST_SCRATCH_DIR="@0@"'.format(test_ibft_dir) + '-DTEST_INITRD_DIR="@0@"'.format(meson.current_source_dir()), ] -exe = executable( - test_unit, - test_unit + '.c', - dependencies: test_nm_dep, - c_args: cflags, - link_with: libnmi_ibft_core -) - -test( - 'ibft/' + test_unit, - test_script, - args: test_args + [exe.full_path()] -) +foreach test_unit : test_units + exe = executable( + test_unit, + test_unit + '.c', + dependencies: test_nm_dep, + c_args: cflags, + link_with: libnmi_core + ) + test( + 'initrd/' + test_unit, + test_script, + args: test_args + [exe.full_path()] + ) +endforeach |