diff --git a/build.zig b/build.zig index 862771d..2d17e3f 100644 --- a/build.zig +++ b/build.zig @@ -44,14 +44,14 @@ pub fn build(b: *std.Build) void { const omt_out_path = "3rd/libomt/bin/Release/net8.0/linux-x64/publish/"; const lib_dir = b.getInstallPath(.lib, ""); - const copy_omt_h = b.installFile( - omt_out_path ++ "libomt.h", - lib_dir ++ "libomt.h", + const copy_omt_h = b.addInstallFile( + b.path(b.pathJoin(&.{ omt_out_path, "libomt.h" })), + b.pathJoin(&.{ lib_dir, "libomt.h" }), ); - const copy_omt_so = b.installFile( - omt_out_path ++ "libomt.so", - lib_dir ++ "libomt.so", + const copy_omt_so = b.addInstallFile( + b.path(b.pathJoin(&.{ omt_out_path, "libomt.so" })), + b.pathJoin(&.{ lib_dir, "libomt.so" }), ); // Define executable @@ -66,6 +66,8 @@ pub fn build(b: *std.Build) void { sender_exe.linkSystemLibrary("omt"); sender_exe.linkLibC(); + sender_exe.step.dependOn(©_omt_h.step); + sender_exe.step.dependOn(©_omt_so.step); const receiver_exe = b.addExecutable(.{ .name = "omtoy-receiver", @@ -78,8 +80,8 @@ pub fn build(b: *std.Build) void { receiver_exe.linkSystemLibrary("omt"); receiver_exe.linkLibC(); - receiver_exe.step.dependOn(©_omt_h); - receiver_exe.step.dependOn(©_omt_so); + receiver_exe.step.dependOn(©_omt_h.step); + receiver_exe.step.dependOn(©_omt_so.step); b.installArtifact(sender_exe); b.installArtifact(receiver_exe);