switch example depedendency based on zig version
All checks were successful
AWS-Zig Build / build-zig-amd64-host (push) Successful in 9m18s
aws-zig nightly build / build-zig-nightly (push) Successful in 8m32s

This commit is contained in:
Emil Lerch 2025-09-03 14:53:51 -07:00
parent e41f98b389
commit 5bfcd10519
Signed by: lobo
GPG key ID: A7B62D657EF764F8
2 changed files with 11 additions and 1 deletions

View file

@ -1,5 +1,10 @@
const std = @import("std"); const std = @import("std");
const next_version_str = "0.16.0-dev.164+bc7955306";
const next_version = std.SemanticVersion.parse(next_version_str) catch unreachable;
const zig_version = @import("builtin").zig_version;
const is_next = zig_version.order(next_version) == .eq or zig_version.order(next_version) == .gt;
// Although this function looks imperative, note that its job is to // Although this function looks imperative, note that its job is to
// declaratively construct a build graph that will be executed by an external // declaratively construct a build graph that will be executed by an external
// runner. // runner.
@ -26,7 +31,8 @@ pub fn build(b: *std.Build) void {
.root_module = mod_exe, .root_module = mod_exe,
}); });
const aws_dep = b.dependency("aws", .{ const aws = if (is_next) "nightly" else "aws";
const aws_dep = b.dependency(aws, .{
// These are the two arguments to the dependency. It expects a target and optimization level. // These are the two arguments to the dependency. It expects a target and optimization level.
.target = target, .target = target,
.optimize = optimize, .optimize = optimize,

View file

@ -9,5 +9,9 @@
.url = "https://git.lerch.org/api/packages/lobo/generic/aws-sdk-with-models/cfc8aee1a6b54eac4a58893674361f1ad58e8595/cfc8aee1a6b54eac4a58893674361f1ad58e8595-with-models.tar.gz", .url = "https://git.lerch.org/api/packages/lobo/generic/aws-sdk-with-models/cfc8aee1a6b54eac4a58893674361f1ad58e8595/cfc8aee1a6b54eac4a58893674361f1ad58e8595-with-models.tar.gz",
.hash = "aws-0.0.1-SbsFcK8HCgA-P7sjZP5z7J7ZfZLTkQ4osD0qgbyUgTzG", .hash = "aws-0.0.1-SbsFcK8HCgA-P7sjZP5z7J7ZfZLTkQ4osD0qgbyUgTzG",
}, },
.nightly = .{
.url = "https://git.lerch.org/api/packages/lobo/generic/aws-sdk-with-models/e41f98b389539c8bc6b1a231d25e2980318e5ef4/e41f98b389539c8bc6b1a231d25e2980318e5ef4nightly-zig-with-models.tar.gz",
.hash = "aws-0.0.1-SbsFcMQRCgCRIXmF1NuTo2olLnF19xwI3L8d_bPNgBrG",
},
}, },
} }