main: Print version in debug output on startup

This will stop needing to ask users that read the README when reporting
bugs but don't include this info.
This commit is contained in:
Bastien Nocera
2021-08-19 20:31:17 +02:00
parent 860405323b
commit a7b603270f
2 changed files with 13 additions and 1 deletions

View File

@@ -7,6 +7,8 @@
*
*/
#include "config.h"
#include <locale.h>
#include <unistd.h>
#include <fcntl.h>
@@ -960,8 +962,10 @@ int main (int argc, char **argv)
return EXIT_FAILURE;
}
if (verbose)
if (verbose) {
g_setenv ("G_MESSAGES_DEBUG", "all", TRUE);
g_debug ("Starting iio-sensor-proxy version "VERSION);
}
data = g_new0 (SensorData, 1);
data->previous_orientation = ORIENTATION_UNDEFINED;

View File

@@ -1,3 +1,10 @@
config_h = configuration_data()
config_h.set_quoted('VERSION', meson.project_version())
config_h_files = configure_file(
output: 'config.h',
configuration: config_h
)
deps = [ gio_dep, gudev_dep, mathlib_dep ]
resources = gnome.compile_resources(
@@ -27,6 +34,7 @@ sources = [
'accel-attributes.c',
'utils.c',
resources,
config_h_files,
]
executable('iio-sensor-proxy',