Skip to content

Commit

Permalink
[fix]
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Jun 11, 2024
1 parent 9a6089a commit fcc58df
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions build/compilation.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ const std = @import ("std");
pub fn addHeader (lib: *std.Build.Step.Compile, source: [] const u8,
dest: [] const u8, ext: [] const [] const u8) void
{
const builder = lib.step.owner;
std.debug.print ("[{s} header] {s}\n", .{ lib.name, source, });
lib.installHeadersDirectory (.{ .cwd_relative = source, }, dest,
lib.installHeadersDirectory (builder.path (source), dest,
.{ .include_extensions = ext, });
}

pub fn addInclude (lib: *std.Build.Step.Compile, path: [] const u8) void
{
const builder = lib.step.owner;
const lazy = std.Build.LazyPath { .cwd_relative = builder.dupe (path), };
const lazy = builder.path (builder.dupe (path));
std.debug.print ("[{s} include] {s}\n",
.{ lib.name, lazy.getPath (builder), });
lib.addIncludePath (lazy);
Expand All @@ -25,8 +26,8 @@ pub fn addSource (lib: *std.Build.Step.Compile, root_path: [] const u8,
&.{ root_path, base_path, });
std.debug.print ("[{s} source] {s}\n", .{ lib.name, source_path, });
lib.addCSourceFile (.{
.file = .{ .cwd_relative = try std.fs.path.relative (builder.allocator,
builder.build_root.path.?, source_path), },
.file = builder.path (try std.fs.path.relative (builder.allocator,
builder.build_root.path.?, source_path)),
.flags = flags,
});
}

0 comments on commit fcc58df

Please sign in to comment.