nation/build.zig
邵静 0a26401108 server, client
1. add server and client demo
2024-07-02 18:03:36 +08:00

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);
}