Skip to content

Commit

Permalink
Use std.Build.path
Browse files Browse the repository at this point in the history
  • Loading branch information
sam701 committed Apr 20, 2024
1 parent beff935 commit c12256b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});

const module = b.addModule("zig-cli", .{
.root_source_file = std.Build.LazyPath.relative("src/main.zig"),
.root_source_file = b.path("src/main.zig"),
});

const lib = b.addStaticLibrary(.{
.name = "zig-cli",
.root_source_file = .{ .path = "src/main.zig" },
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
});
b.installArtifact(lib);

const main_tests = b.addTest(.{
.root_source_file = .{ .path = "src/tests.zig" },
.root_source_file = b.path("src/tests.zig"),
.target = target,
.optimize = optimize,
});
Expand All @@ -28,7 +28,7 @@ pub fn build(b: *std.Build) void {
const simple = b.addExecutable(.{
.target = target,
.name = "simple",
.root_source_file = .{ .path = "examples/simple.zig" },
.root_source_file = b.path("examples/simple.zig"),
.optimize = optimize,
});
simple.root_module.addImport("zig-cli", module);
Expand All @@ -37,7 +37,7 @@ pub fn build(b: *std.Build) void {
const short = b.addExecutable(.{
.target = target,
.name = "short",
.root_source_file = .{ .path = "examples/short.zig" },
.root_source_file = b.path("examples/short.zig"),
.optimize = optimize,
});
short.root_module.addImport("zig-cli", module);
Expand Down

0 comments on commit c12256b

Please sign in to comment.