diff options
| author | Patrick Schönberger | 2026-06-08 10:52:34 +0200 |
|---|---|---|
| committer | Patrick Schönberger | 2026-06-08 10:52:34 +0200 |
| commit | 888331271765f4acb0a6eae4e9535fcad29e6a11 (patch) | |
| tree | dcbce9a4016f0fcb7c37e0825ddb198746bfd2b5 /build.zig | |
| download | nmap-main.tar.gz nmap-main.zip | |
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/build.zig b/build.zig new file mode 100644 index 0000000..e6065a1 --- /dev/null +++ b/build.zig @@ -0,0 +1,26 @@ +const std = @import("std"); + +pub fn build(b: *std.Build) void { + const target = b.standardTargetOptions(.{}); + const optimize = b.standardOptimizeOption(.{}); + + const exe = b.addExecutable(.{ + .name = "nmap", + .root_module = b.createModule(.{ + .root_source_file = b.path("src/main.zig"), + .target = target, + .optimize = optimize, + }), + }); + b.installArtifact(exe); + + const exe_run = b.addRunArtifact(exe); + const exe_run_step = b.step("run", "Run"); + exe_run_step.dependOn(&exe_run.step); + exe_run.step.dependOn(b.getInstallStep()); + if (b.args) |args| exe_run.addArgs(args); + + const exe_test = b.addTest(.{ .root_module = exe.root_module }); + const exe_test_step = b.step("test", "Run tests"); + exe_test_step.dependOn(&b.addRunArtifact(exe_test).step); +} |
