protobuf-c/build.zig
2024-09-14 20:24:22 -07:00

30 lines
705 B
Zig

const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const upstream = b.dependency("protobuf_c", .{});
const lib = b.addStaticLibrary(.{
.name = "protobuf_c",
.target = target,
.optimize = optimize,
});
lib.linkLibC();
const src_root = upstream.path("protobuf-c");
lib.addCSourceFiles(.{
.root = src_root,
.files = &.{"protobuf-c.c"},
.flags = &.{},
});
lib.installHeader(
src_root.path(b, "protobuf-c.h"),
b.pathJoin(&.{ "protobuf-c", "protobuf-c.h" }),
);
b.installArtifact(lib);
}