0a26401108
1. add server and client demo
33 lines
1.0 KiB
Zig
33 lines
1.0 KiB
Zig
const std = @import("std");
|
|
|
|
pub fn build(b: *std.Build) void {
|
|
const target = b.standardTargetOptions(.{});
|
|
const optimize = b.standardOptimizeOption(.{});
|
|
|
|
const server = b.addExecutable(.{
|
|
.name = "nations",
|
|
.root_source_file = b.path("src/server.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
});
|
|
const client = b.addExecutable(.{
|
|
.name = "nationc",
|
|
.root_source_file = b.path("src/client.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
});
|
|
|
|
b.installArtifact(server);
|
|
b.installArtifact(client);
|
|
const server_run_cmd = b.addRunArtifact(server);
|
|
const client_run_cmd = b.addRunArtifact(client);
|
|
|
|
server_run_cmd.step.dependOn(b.getInstallStep());
|
|
client_run_cmd.step.dependOn(b.getInstallStep());
|
|
|
|
const server_run_step = b.step("runs", "Run the server");
|
|
const client_run_step = b.step("runc", "Run the client");
|
|
server_run_step.dependOn(&server_run_cmd.step);
|
|
client_run_step.dependOn(&client_run_cmd.step);
|
|
}
|