]> www.infradead.org Git - users/sagi/nvme-cli.git/commit
build: Add support for meson build system
authorDaniel Wagner <dwagner@suse.de>
Mon, 11 Oct 2021 16:59:22 +0000 (18:59 +0200)
committerDaniel Wagner <dwagner@suse.de>
Wed, 13 Oct 2021 11:51:04 +0000 (13:51 +0200)
commit9d99a813240c2653fd88ab1c3cb887650b18822d
tree93eb0c067dbb167f01a417c5b012a359732cfa43
parent28d0815a57ffe9402a11a55923820837290b0a0f
build: Add support for meson build system

Add meson build system. I tried to mimic the existing Makefile style
but there are a couple of noteworthy differentiation.

 - meson has the concept of subprojects. It is able to download (via
   git) the dependencies (libnvme) and add them directly into the
   build system unless the library is found on the host machine
   (PKG_CONFIG_PATH needs to point to libnvme). This makes git
   submodules unnecessary. The nice thing is that we get a very simple
   setup for CI. meson knows how to download and the dependencies into
   the build.

   To make all this work the git submodule needs to be removed when we
   start using meson to build the project. 'meson dist' bundles
   libnvme into the final tar. We could obviously remove it again via
   add_dist_script but this seems not worth the time.

 - meson uses project_version() to set the version string. This is
   usually just a string (or read from a file). I added the script
   hack so that we keep the versioning consistent with the Makefile,
   e.g. that tar file has the 'git describe' version and 'nvme
   --version' says the same. For a new release, the script
   'nvme-cli-version' needs to be updated (like NVME-VERSION_GEN) and
   the release needs to be tagged before one runs 'meson dist'. I
   guess in the long run we could just set the project_version string
   in meson.build and introduce a package_version which is based on
   git. This is how systemd handles this.

 - The github workflow disables the unit tests for nvme-cli (but not
   for libnvme) by not installing nose2. Those tests fail at the
   moment.

There are still many things very rough or missing, e.g. the install
targets. But this seems like a good first version to get things going.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
.github/workflows/meson.yml [new file with mode: 0644]
.gitignore
meson.build [new file with mode: 0644]
nvme-cli-version [new file with mode: 0755]
plugins/meson.build [new file with mode: 0644]
subprojects/libnvme.wrap [new file with mode: 0644]
tests/meson.build [new file with mode: 0644]
util/meson.build [new file with mode: 0644]