diff options
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 51 |
1 files changed, 24 insertions, 27 deletions
@@ -2,39 +2,36 @@ const std = @import("std"); pub fn build(b: *std.Build) !void { const target = b.standardTargetOptions(.{}); - const optimize = b.standardOptimizeOption(.{.preferred_optimize_mode = .ReleaseSmall }); + const optimize = b.standardOptimizeOption(.{}); - _=b.addModule("funcz", .{ + const rootmod =b.addModule("funcz", .{ .root_source_file = b.path("src/root.zig"), - .optimize = optimize, .target = target, + .optimize = optimize, }); - // const options = b.addOptions(); - // rootmod.addOptions("build", options); - // const lib = b.addLibrary(.{ - // .name = "funcz", - // .root_module = rootmod, - // }); - // - // b.installArtifact(lib); + const lib = b.addLibrary(.{ + .name = "funcz", + .root_module = rootmod, + }); - // const exe = b.addExecutable(.{ - // .name = "funczExample", - // .root_module = b.createModule(.{ - // .root_source_file = b.path("src/example.zig"), - // .imports = &.{ .{.name = "funcz", .module = lib.root_module} }, - // .target = target, - // .optimize = optimize, - // }) - // }); - // - // b.installArtifact(exe); + b.installArtifact(lib); + + const exe = b.addExecutable(.{ + .name = "funczExample", + .root_module = b.createModule(.{ + .root_source_file = b.path("src/example.zig"), + .imports = &.{ .{.name = "funcz", .module = lib.root_module} }, + .target = target, + .optimize = optimize, + }) + }); - // 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); + 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); } |
