diff --git a/bin/mangohud.in b/bin/mangohud.in index b1a396ce..6c3c6e8b 100755 --- a/bin/mangohud.in +++ b/bin/mangohud.in @@ -15,6 +15,11 @@ if [ "$1" = "--dlsym" ]; then shift fi +if [ "$1" = "--version" ]; then + echo @version@ + exit 0 +fi + # Make sure we don't append mangohud lib multiple times # otherwise this could cause issues with steam runtime case ":${LD_PRELOAD-}:" in diff --git a/src/meson.build b/src/meson.build index ed004ac7..90df1f19 100644 --- a/src/meson.build +++ b/src/meson.build @@ -14,6 +14,7 @@ conf_data = configuration_data() conf_data.set('ld_libdir_mangohud_abs', libdir_mangohud) conf_data.set('ld_libdir_mangohud', ld_libdir_mangohud) conf_data.set('cpu_family', host_machine.cpu_family()) +conf_data.set('version', run_command(['git', 'describe', '--tags', '--dirty=+']).stdout().strip()) overlay_shaders = [ 'overlay.frag',