build libvmx with zig (wip)
This commit is contained in:
26
build.zig
26
build.zig
@@ -37,17 +37,25 @@ pub fn build(b: *std.Build) void {
|
||||
libomt_build.step.dependOn(&libomtnet_build.step);
|
||||
// TODO: install libomt.so and libomt.h in a more convenient location
|
||||
|
||||
// Build libvmx
|
||||
const libvmx_build = b.addSystemCommand(&.{"bash"});
|
||||
libvmx_build.addFileArg(b.path("3rd/libvmx/build/buildlinuxx64.sh"));
|
||||
libvmx_build.cwd = b.path("3rd/libvmx/build");
|
||||
const libvmx_build = b.addLibrary(.{
|
||||
.root_module //todo
|
||||
.name = "libvmx",
|
||||
.linkage = .dynamic,
|
||||
});
|
||||
libvmx_build.linkLibCpp();
|
||||
libvmx_build.root_module.addCSourceFiles(.{
|
||||
.root = b.path("3rd/libvmx/build/"),
|
||||
.files = .{ "../src/vmxcodec_x86.cpp", "../src/vmxcodec_avx2.cpp", "../src/vmxcodec.cpp" },
|
||||
.flags = .{ "-O3", "-std=c++17", "-fdeclspec", "-fPIC", "-mlzcnt", "-mavx2", "-mbmi", "-shared", "-Wl,-rpath,'$ORIGIN'" },
|
||||
.language = null,
|
||||
});
|
||||
|
||||
// Copy libvmx to a place of happiness
|
||||
// TODO: Runs but doesn't do what I'd expect it to. What's going on?
|
||||
const libvmx_copy = b.addSystemCommand(&.{"cp"});
|
||||
libvmx_copy.addFileArg(b.path("3rd/libvmx/build/libvmx.so"));
|
||||
_ = libvmx_copy.addOutputFileArg("3rd/libomt/bin/Release/net8.0/linux-x64/publish/");
|
||||
libvmx_copy.step.dependOn(&libvmx_build.step);
|
||||
// const libvmx_copy = b.addSystemCommand(&.{"cp"});
|
||||
// libvmx_copy.addFileArg(b.path("3rd/libvmx/build/libvmx.so"));
|
||||
// _ = libvmx_copy.addOutputFileArg("3rd/libomt/bin/Release/net8.0/linux-x64/publish/libvmx.so");
|
||||
// libvmx_copy.step.dependOn(&libvmx_build.step);
|
||||
|
||||
// Define executable
|
||||
const sender_exe = b.addExecutable(.{
|
||||
@@ -87,7 +95,7 @@ pub fn build(b: *std.Build) void {
|
||||
// Manual build step for libomt dependencies
|
||||
const build_omt_step = b.step("build-omt", "Build libomt and libomtnet");
|
||||
build_omt_step.dependOn(&libomt_build.step);
|
||||
build_omt_step.dependOn(&libvmx_copy.step);
|
||||
// build_omt_step.dependOn(&libvmx_copy.step);
|
||||
|
||||
// Add run step for sender
|
||||
const run_sender_step = b.step("sender-run", "Run the sender client");
|
||||
|
||||
Reference in New Issue
Block a user