meson: introduce PROJECT_VERSION_STR and use it in udev

This commit is contained in:
Ivan Kruglov
2024-11-12 13:53:13 +01:00
parent 6d07d23b02
commit 8c823a038c
3 changed files with 4 additions and 2 deletions

View File

@@ -33,6 +33,8 @@ conf = configuration_data()
conf.set_quoted('PROJECT_URL', 'https://systemd.io/')
conf.set('PROJECT_VERSION', project_major_version,
description : 'Numerical project version (used where a simple number is expected)')
conf.set_quoted('PROJECT_VERSION_STR', project_major_version,
description: 'Stringified project version (used where a simple string is expected)')
conf.set_quoted('PROJECT_VERSION_FULL', meson.project_version(), description : 'Full project version')
relative_source_path = run_command('realpath',

View File

@@ -293,7 +293,7 @@ int udev_ctrl_start(UdevCtrl *uctrl, udev_ctrl_handler_t callback, void *userdat
int udev_ctrl_send(UdevCtrl *uctrl, UdevCtrlMessageType type, const void *data) {
UdevCtrlMessageWire ctrl_msg_wire = {
.version = "udev-" STRINGIFY(PROJECT_VERSION),
.version = "udev-" PROJECT_VERSION_STR,
.magic = UDEV_CTRL_MAGIC,
.type = type,
};

View File

@@ -20,6 +20,6 @@ int lock_main(int argc, char *argv[], void *userdata);
static inline int print_version(void) {
/* Dracut relies on the version being a single integer */
puts(STRINGIFY(PROJECT_VERSION));
puts(PROJECT_VERSION_STR);
return 0;
}