commit 84b6cd7bc5158a00badaa0c79694d1b6b3d7a2a5
Author: Andrea Feletto <andrea@andreafeletto.com>
Date: Tue, 4 Jan 2022 12:46:29 +0100
zig project setup
Diffstat:
3 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -0,0 +1,2 @@
+zig-cache/
+zig-out/
diff --git a/build.zig b/build.zig
@@ -0,0 +1,27 @@
+const std = @import("std");
+
+pub fn build(b: *std.build.Builder) void {
+ const target = b.standardTargetOptions(.{});
+ const mode = b.standardReleaseOptions();
+
+ const exe = b.addExecutable("levee", "src/main.zig");
+ exe.setTarget(target);
+ exe.setBuildMode(mode);
+ exe.install();
+
+ const run_cmd = exe.run();
+ run_cmd.step.dependOn(b.getInstallStep());
+ if (b.args) |args| {
+ run_cmd.addArgs(args);
+ }
+
+ const run_step = b.step("run", "Run the app");
+ run_step.dependOn(&run_cmd.step);
+
+ const exe_tests = b.addTest("src/main.zig");
+ exe_tests.setTarget(target);
+ exe_tests.setBuildMode(mode);
+
+ const test_step = b.step("test", "Run unit tests");
+ test_step.dependOn(&exe_tests.step);
+}
diff --git a/src/main.zig b/src/main.zig
@@ -0,0 +1,4 @@
+const std = @import("std");
+
+pub fn main() anyerror!void {
+}