]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: introduce PROJECT_VERSION_STR and use it in udev
authorIvan Kruglov <mail@ikruglov.com>
Tue, 12 Nov 2024 12:53:13 +0000 (13:53 +0100)
committerIvan Kruglov <mail@ikruglov.com>
Tue, 13 May 2025 08:53:22 +0000 (01:53 -0700)
meson.build
src/udev/udev-ctrl.c
src/udev/udevadm.h

index 48b8b05834922e4b742932c849342dfa20f99484..ebe24c6290f08d03983891c848923e1463dfb8ac 100644 (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',
index 1914bf7929f2a2b61abc282d9fd94a2819b0c6a3..10dd48164a2116210fb8e1cf090b83eda1b33ea4 100644 (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,
         };
index e39dbf655d474a9a360ac0a92d4ffc3af3982b8a..665d2f46b37dcc5eca4470063d1e46372cc75a58 100644 (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;
 }