summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorĒriks Remess <eriks@remess.lv>2025-10-09 16:02:40 +0300
committerĒriks Remess <eriks@remess.lv>2025-10-09 16:02:40 +0300
commitf4b051a84c225a1aadc2fe16fcebd3fce24f2eb2 (patch)
tree9edd7e147f379c09138cb77f0973b33ec20f482f /src
parent3b2ef4c216c2f720330aeb50c51f942fccac5156 (diff)
use app_version from build.zig.zon
Diffstat (limited to 'src')
-rw-r--r--src/build/Config.zig10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/build/Config.zig b/src/build/Config.zig
index 643dfe928..745fc926f 100644
--- a/src/build/Config.zig
+++ b/src/build/Config.zig
@@ -16,13 +16,6 @@ const expandPath = @import("../os/path.zig").expand;
const gtk = @import("gtk.zig");
const GitVersion = @import("GitVersion.zig");
-/// The version of the next release.
-///
-/// TODO: When Zig 0.14 is released, derive this from build.zig.zon directly.
-/// Until then this MUST match build.zig.zon and should always be the
-/// _next_ version to release.
-const app_version: std.SemanticVersion = .{ .major = 1, .minor = 2, .patch = 1 };
-
/// Standard build configuration options.
optimize: std.builtin.OptimizeMode,
target: std.Build.ResolvedTarget,
@@ -69,7 +62,7 @@ emit_unicode_table_gen: bool = false,
/// Environmental properties
env: std.process.EnvMap,
-pub fn init(b: *std.Build) !Config {
+pub fn init(b: *std.Build, appVersion: []const u8) !Config {
// Setup our standard Zig target and optimize options, i.e.
// `-Doptimize` and `-Dtarget`.
const optimize = b.standardOptimizeOption(.{});
@@ -217,6 +210,7 @@ pub fn init(b: *std.Build) !Config {
// If an explicit version is given, we always use it.
try std.SemanticVersion.parse(v)
else version: {
+ const app_version = try std.SemanticVersion.parse(appVersion);
// If no explicit version is given, we try to detect it from git.
const vsn = GitVersion.detect(b) catch |err| switch (err) {
// If Git isn't available we just make an unknown dev version.