2024-09-14 20:10:10 -07:00
|
|
|
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", .{});
|
|
|
|
|
|
2025-12-06 16:33:43 +01:00
|
|
|
const lib = b.addLibrary(.{
|
2024-09-14 20:10:10 -07:00
|
|
|
.name = "protobuf_c",
|
2025-12-06 16:33:43 +01:00
|
|
|
.root_module = b.createModule(.{
|
|
|
|
|
.target = target,
|
|
|
|
|
.optimize = optimize,
|
|
|
|
|
.link_libc = true,
|
|
|
|
|
}),
|
2024-09-14 20:10:10 -07:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
lib.addCSourceFiles(.{
|
|
|
|
|
.root = upstream.path("protobuf-c"),
|
|
|
|
|
.files = &.{"protobuf-c.c"},
|
|
|
|
|
.flags = &.{},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
lib.installHeader(
|
|
|
|
|
upstream.path("protobuf-c/protobuf-c.h"),
|
|
|
|
|
b.pathJoin(&.{ "protobuf-c", "protobuf-c.h" }),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
b.installArtifact(lib);
|
|
|
|
|
}
|