still trying to get sensible install path (wip)
This commit is contained in:
18
build.zig
18
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 omt_out_path = "3rd/libomt/bin/Release/net8.0/linux-x64/publish/";
|
||||||
const lib_dir = b.getInstallPath(.lib, "");
|
const lib_dir = b.getInstallPath(.lib, "");
|
||||||
|
|
||||||
const copy_omt_h = b.installFile(
|
const copy_omt_h = b.addInstallFile(
|
||||||
omt_out_path ++ "libomt.h",
|
b.path(b.pathJoin(&.{ omt_out_path, "libomt.h" })),
|
||||||
lib_dir ++ "libomt.h",
|
b.pathJoin(&.{ lib_dir, "libomt.h" }),
|
||||||
);
|
);
|
||||||
|
|
||||||
const copy_omt_so = b.installFile(
|
const copy_omt_so = b.addInstallFile(
|
||||||
omt_out_path ++ "libomt.so",
|
b.path(b.pathJoin(&.{ omt_out_path, "libomt.so" })),
|
||||||
lib_dir ++ "libomt.so",
|
b.pathJoin(&.{ lib_dir, "libomt.so" }),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Define executable
|
// Define executable
|
||||||
@@ -66,6 +66,8 @@ pub fn build(b: *std.Build) void {
|
|||||||
|
|
||||||
sender_exe.linkSystemLibrary("omt");
|
sender_exe.linkSystemLibrary("omt");
|
||||||
sender_exe.linkLibC();
|
sender_exe.linkLibC();
|
||||||
|
sender_exe.step.dependOn(©_omt_h.step);
|
||||||
|
sender_exe.step.dependOn(©_omt_so.step);
|
||||||
|
|
||||||
const receiver_exe = b.addExecutable(.{
|
const receiver_exe = b.addExecutable(.{
|
||||||
.name = "omtoy-receiver",
|
.name = "omtoy-receiver",
|
||||||
@@ -78,8 +80,8 @@ pub fn build(b: *std.Build) void {
|
|||||||
|
|
||||||
receiver_exe.linkSystemLibrary("omt");
|
receiver_exe.linkSystemLibrary("omt");
|
||||||
receiver_exe.linkLibC();
|
receiver_exe.linkLibC();
|
||||||
receiver_exe.step.dependOn(©_omt_h);
|
receiver_exe.step.dependOn(©_omt_h.step);
|
||||||
receiver_exe.step.dependOn(©_omt_so);
|
receiver_exe.step.dependOn(©_omt_so.step);
|
||||||
|
|
||||||
b.installArtifact(sender_exe);
|
b.installArtifact(sender_exe);
|
||||||
b.installArtifact(receiver_exe);
|
b.installArtifact(receiver_exe);
|
||||||
|
|||||||
Reference in New Issue
Block a user