aboutsummaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig34
1 files changed, 34 insertions, 0 deletions
diff --git a/build.zig b/build.zig
new file mode 100644
index 0000000..99b3ef9
--- /dev/null
+++ b/build.zig
@@ -0,0 +1,34 @@
+const std = @import("std");
+
+pub fn build(b: *std.Build) !void {
+ const target = b.standardTargetOptions(.{});
+ const optimize = b.standardOptimizeOption(.{.preferred_optimize_mode = .ReleaseSmall });
+
+ const lib = b.addLibrary(.{
+ .name = "funcz",
+ .root_module = b.createModule(.{
+ .root_source_file = b.path("src/lib.zig"),
+ .target = target,
+ .optimize = optimize,
+ }),
+ });
+ b.installArtifact(lib);
+
+ const exe = b.addExecutable(.{
+ .name = "funczExample",
+ .root_module = b.createModule(.{
+ .root_source_file = b.path("src/main.zig"),
+ .imports = &.{ .{.name = "funcz", .module = lib.root_module} },
+ .target = target,
+ .optimize = optimize,
+ })
+ });
+ b.installArtifact(exe);
+
+ const run_cmd = b.addRunArtifact(exe);
+ 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);
+
+}