Skip to content

Commit

Permalink
wip updating build.zig
Browse files Browse the repository at this point in the history
  • Loading branch information
Arwalk committed Jan 31, 2024
1 parent e8c20a9 commit f5c1945
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const mem = std.mem;

const PROTOC_VERSION = "23.4";

pub fn build(b: *std.build.Builder) !void {
pub fn build(b: *std.Build) !void {
// Standard target options allows the person running `zig build` to choose
// what target to build for. Here we do not override the defaults, which
// means any target is allowed, and the default is native. Other options
Expand All @@ -34,11 +34,11 @@ pub fn build(b: *std.build.Builder) !void {
b.installArtifact(lib);

const module = b.addModule("protobuf", .{
.source_file = .{ .path = "src/protobuf.zig" },
.root_source_file = .{ .path = "src/protobuf.zig" },
});

const exe = buildGenerator(b, .{
.target = target,
.target = target.query,
.optimize = optimize,
});

Expand All @@ -49,7 +49,7 @@ pub fn build(b: *std.build.Builder) !void {

const test_step = b.step("test", "Run library tests");

const tests = [_]*std.build.LibExeObjStep{
const tests = [_]*std.Build.Step.Compile{
b.addTest(.{
.name = "protobuf",
.root_source_file = .{ .path = "src/protobuf.zig" },
Expand Down Expand Up @@ -140,16 +140,16 @@ pub const RunProtocStep = struct {
step: Step,
source_files: []const []const u8,
include_directories: []const []const u8,
destination_directory: std.build.FileSource,
generator: *std.build.Step.Compile,
destination_directory: std.Build.FileSource,
generator: *std.Build.Step.Compile,
verbose: bool = false, // useful for debugging if you need to know what protoc command is sent

pub const base_id = .protoc;

pub const Options = struct {
source_files: []const []const u8,
include_directories: []const []const u8 = &.{},
destination_directory: std.build.FileSource,
destination_directory: std.Build.FileSource,
};

pub const StepErr = error{
Expand Down Expand Up @@ -243,7 +243,7 @@ pub const GenOptions = struct {
optimize: std.builtin.OptimizeMode = .Debug,
};

pub fn buildGenerator(b: *std.build.Builder, opt: GenOptions) *std.build.Step.Compile {
pub fn buildGenerator(b: *std.Build, opt: GenOptions) *std.Build.Step.Compile {
const exe = b.addExecutable(.{
.name = "protoc-gen-zig",
// In this case the main source file is merely a path, however, in more
Expand Down

0 comments on commit f5c1945

Please sign in to comment.