Skip to content

Commit

Permalink
Merge pull request #29 from Reokodoku/b-path
Browse files Browse the repository at this point in the history
Use `b.path` to initialize LazyPath
  • Loading branch information
Arnau478 authored May 15, 2024
2 parents 62b0e34 + a410350 commit 4c34e78
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 @@ -71,7 +71,7 @@ fn getVersion(b: *std.Build) SemanticVersion {
fn addExe(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, release: bool, build_options: *std.Build.Step.Options, hevi_mod: *std.Build.Module) *std.Build.Step.Compile {
const exe = b.addExecutable(.{
.name = if (release) b.fmt("hevi-{s}-{s}", .{ @tagName(target.result.cpu.arch), @tagName(target.result.os.tag) }) else "hevi",
.root_source_file = .{ .path = "src/main.zig" },
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
});
Expand All @@ -91,7 +91,7 @@ pub fn build(b: *std.Build) !void {
build_options.addOption(SemanticVersion, "version", getVersion(b));

const mod = b.addModule("hevi", .{
.root_source_file = .{ .path = "src/hevi.zig" },
.root_source_file = b.path("src/hevi.zig"),
});

const exe = addExe(b, target, optimize, false, build_options, mod);
Expand All @@ -103,7 +103,7 @@ pub fn build(b: *std.Build) !void {
.name = "hevi",
.target = target,
.optimize = .Debug,
.root_source_file = .{ .path = "src/hevi.zig" },
.root_source_file = b.path("src/hevi.zig"),
});
docs_obj.root_module.addOptions("build_options", build_options);

Expand All @@ -117,7 +117,7 @@ pub fn build(b: *std.Build) !void {

const web_step = b.step("web", "Build the whole web page");
const web_wf = b.addWriteFiles();
_ = web_wf.addCopyDirectory(.{ .path = "web" }, "", .{});
_ = web_wf.addCopyDirectory(b.path("web"), "", .{});
_ = web_wf.addCopyDirectory(docs, "docs", .{});
web_step.dependOn(&b.addInstallDirectory(.{
.source_dir = web_wf.getDirectory(),
Expand All @@ -143,7 +143,7 @@ pub fn build(b: *std.Build) !void {
run_step.dependOn(&run_cmd.step);

const unit_tests = b.addTest(.{
.root_source_file = .{ .path = "src/main.zig" },
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
});
Expand Down

0 comments on commit 4c34e78

Please sign in to comment.