commit ba2a5a7787b0b26ce3cbe70e31e112f2d15fb35b
parent 72ec410134e04705b30f8afc5bfb641500fb0629
Author: bfredl <bjorn.linse@gmail.com>
Date: Sun, 4 May 2025 19:35:07 +0200
Merge pull request #33837 from bfredl/cmakeversion
fix(build): use correct cmake expression for $<CONFIG>
fixes #33835
Diffstat:
3 files changed, 7 insertions(+), 18 deletions(-)
diff --git a/build.zig b/build.zig
@@ -153,11 +153,12 @@ pub fn build(b: *std.Build) !void {
config_str = b.fmt("{s} -Dcross -Dtarget={s} (host: {s})", .{ config_str, try t.linuxTriple(b.allocator), try b.graph.host.result.linuxTriple(b.allocator) });
}
- const versiondef_step = b.addConfigHeader(.{ .style = .{ .cmake = b.path("src/versiondef.h.in") } }, .{
+ const versiondef_step = b.addConfigHeader(.{ .style = .{ .cmake = b.path("cmake.config/versiondef.h.in") } }, .{
.NVIM_VERSION_MAJOR = version.major,
.NVIM_VERSION_MINOR = version.minor,
.NVIM_VERSION_PATCH = version.patch,
.NVIM_VERSION_PRERELEASE = version.prerelease,
+ .NVIM_VERSION_MEDIUM = "",
.VERSION_STRING = "TODO", // TODO(bfredl): not sure what to put here. summary already in "config_str"
.CONFIG = config_str,
});
diff --git a/cmake.config/versiondef.h.in b/cmake.config/versiondef.h.in
@@ -12,6 +12,10 @@
#endif
#define NVIM_VERSION_CFLAGS "${VERSION_STRING}"
-#define NVIM_VERSION_BUILD_TYPE "${CONFIG}"
+#ifdef ZIG_BUILD
+# define NVIM_VERSION_BUILD_TYPE "${CONFIG}"
+#else
+# define NVIM_VERSION_BUILD_TYPE "$<CONFIG>"
+#endif
#endif // AUTO_VERSIONDEF_H
diff --git a/src/versiondef.h.in b/src/versiondef.h.in
@@ -1,16 +0,0 @@
-#ifndef AUTO_VERSIONDEF_H
-#define AUTO_VERSIONDEF_H
-
-#define NVIM_VERSION_MAJOR @NVIM_VERSION_MAJOR@
-#define NVIM_VERSION_MINOR @NVIM_VERSION_MINOR@
-#define NVIM_VERSION_PATCH @NVIM_VERSION_PATCH@
-#define NVIM_VERSION_PRERELEASE "@NVIM_VERSION_PRERELEASE@"
-
-#ifndef NVIM_VERSION_MEDIUM
-# include "auto/versiondef_git.h"
-#endif
-
-#define NVIM_VERSION_CFLAGS "${VERSION_STRING}"
-#define NVIM_VERSION_BUILD_TYPE "${CONFIG}"
-
-#endif // AUTO_VERSIONDEF_H