]> www.infradead.org Git - users/sagi/libnvme.git/commit
build: Add git ref to the binary
authorDaniel Wagner <dwagner@suse.de>
Tue, 12 Apr 2022 11:24:27 +0000 (13:24 +0200)
committerDaniel Wagner <dwagner@suse.de>
Tue, 12 Apr 2022 11:33:21 +0000 (13:33 +0200)
commit1503223f835444e2c8911eb848eab0b8c29f15bc
tree0fea343bef14283c60b234df8ad9ba9e3530ede0
parent033449f7c61c130fd21f0a747075dc15069f73f0
build: Add git ref to the binary

In order to be able to figure out which binary is in use (for example
in debugging situation) it's really helpful to have the 'git describe'
ref added to the binary.

The simplest way to expose the it via good old Source Code Control
System string id. No need to come up with something complicated else
as there is no agreement on how to do this. So let's add this simple
magic string to library.

You can either query with 'what' or just

  $strings .build/src/libnvme.so | grep '@(#)'
  @(#)libnvme 1.0-1-g5ff5d22+

The idea how to extract the version string is shamelessly copied from
the systemd project.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
meson-vcs-tag.sh [new file with mode: 0755]
meson.build
meson_options.txt
src/nvme/util.c