Skip to content

Commit

Permalink
build: add main build
Browse files Browse the repository at this point in the history
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
  • Loading branch information
jsign committed Aug 26, 2023
1 parent 1ae50b9 commit 5383485
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,29 @@ pub fn build(b: *std.Build) void {

_ = b.addModule("poseidon", Builder.CreateModuleOptions{ .source_file = .{ .path = "src/poseidon.zig" } });

const exe = b.addExecutable(.{
.name = "zig-poseidon",
.root_source_file = .{ .path = "src/main.zig" },
.target = target,
.optimize = optimize,
});
b.installArtifact(exe);

const run_cmd = b.addRunArtifact(exe);
run_cmd.step.dependOn(b.getInstallStep());

// This allows the user to pass arguments to the application in the build
// command itself, like this: `zig build run -- arg1 arg2 etc`
if (b.args) |args| {
run_cmd.addArgs(args);
}

// This creates a build step. It will be visible in the `zig build --help` menu,
// and can be selected like this: `zig build run`
// This will evaluate the `run` step rather than the default, which is "install".
const run_step = b.step("run", "Run the app");
run_step.dependOn(&run_cmd.step);

const lib = b.addStaticLibrary(.{
.name = "zig-poseidon",
// In this case the main source file is merely a path, however, in more
Expand Down

0 comments on commit 5383485

Please sign in to comment.