From 63da35e57c3695a787b927e69e4140eb74ffc234 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Thu, 1 Feb 2024 18:24:26 -0700 Subject: [PATCH] addPaths(step) -> addPaths(mod); helps hexops/mach#1154 Signed-off-by: Stephen Gutekanst --- build.zig | 18 +++++------------- build.zig.zon | 4 ++-- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/build.zig b/build.zig index ed516ab..355ab83 100644 --- a/build.zig +++ b/build.zig @@ -10,10 +10,13 @@ pub fn build(b: *std.Build) !void { .optimize = optimize, }); - const module = b.addModule("mach-glfw", .{ + var module = b.addModule("mach-glfw", .{ + .target = target, + .optimize = optimize, .root_source_file = .{ .path = "src/main.zig" }, }); module.linkLibrary(glfw_dep.artifact("glfw")); + @import("glfw").addPaths(module); const test_step = b.step("test", "Run library tests"); const main_tests = b.addTest(.{ @@ -23,23 +26,12 @@ pub fn build(b: *std.Build) !void { .optimize = optimize, }); main_tests.linkLibrary(glfw_dep.artifact("glfw")); - addPaths(main_tests); + @import("glfw").addPaths(&main_tests.root_module); b.installArtifact(main_tests); test_step.dependOn(&b.addRunArtifact(main_tests).step); } -pub fn link(b: *std.Build, step: *std.Build.Step.Compile) void { - _ = b; - _ = step; - - @panic(".link(b, step) has been replaced by .addPaths(step)"); -} - -pub fn addPaths(step: *std.Build.Step.Compile) void { - @import("glfw").addPaths(step); -} - comptime { const supported_zig = std.SemanticVersion.parse("0.12.0-dev.2063+804cee3b9") catch unreachable; if (builtin.zig_version.order(supported_zig) != .eq) { diff --git a/build.zig.zon b/build.zig.zon index e4908b2..8342bce 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -12,8 +12,8 @@ }, .dependencies = .{ .glfw = .{ - .url = "https://pkg.machengine.org/glfw/7b1a45feeacf876428bfbd924d4aca9a9a158cd9.tar.gz", - .hash = "122052f6e113bb8c74fceb80de8e92b6dce5792213ab703be2584bb638ec30f36edf", + .url = "https://pkg.machengine.org/glfw/586e14a964740747ca7913fc17096b3bb3d52409.tar.gz", + .hash = "122091debcee20ff2aaf983a9e8c215d4e50cc6caf44975442218901ea728e7dd79a", }, }, }