diff options
Diffstat (limited to 'lib/std/Build/Module.zig')
| -rw-r--r-- | lib/std/Build/Module.zig | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/lib/std/Build/Module.zig b/lib/std/Build/Module.zig index a142bbd405..a5163b13af 100644 --- a/lib/std/Build/Module.zig +++ b/lib/std/Build/Module.zig @@ -89,10 +89,10 @@ pub const CSourceFile = struct { file: LazyPath, flags: []const []const u8 = &.{}, - pub fn dupe(self: CSourceFile, b: *std.Build) CSourceFile { + pub fn dupe(file: CSourceFile, b: *std.Build) CSourceFile { return .{ - .file = self.file.dupe(b), - .flags = b.dupeStrings(self.flags), + .file = file.file.dupe(b), + .flags = b.dupeStrings(file.flags), }; } }; @@ -115,12 +115,12 @@ pub const RcSourceFile = struct { /// as `/I <resolved path>`. include_paths: []const LazyPath = &.{}, - pub fn dupe(self: RcSourceFile, b: *std.Build) RcSourceFile { - const include_paths = b.allocator.alloc(LazyPath, self.include_paths.len) catch @panic("OOM"); - for (include_paths, self.include_paths) |*dest, lazy_path| dest.* = lazy_path.dupe(b); + pub fn dupe(file: RcSourceFile, b: *std.Build) RcSourceFile { + const include_paths = b.allocator.alloc(LazyPath, file.include_paths.len) catch @panic("OOM"); + for (include_paths, file.include_paths) |*dest, lazy_path| dest.* = lazy_path.dupe(b); return .{ - .file = self.file.dupe(b), - .flags = b.dupeStrings(self.flags), + .file = file.file.dupe(b), + .flags = b.dupeStrings(file.flags), .include_paths = include_paths, }; } @@ -665,24 +665,19 @@ pub fn appendZigProcessFlags( for (m.include_dirs.items) |include_dir| { switch (include_dir) { .path => |include_path| { - try zig_args.append("-I"); - try zig_args.append(include_path.getPath(b)); + try zig_args.appendSlice(&.{ "-I", include_path.getPath2(b, asking_step) }); }, .path_system => |include_path| { - try zig_args.append("-isystem"); - try zig_args.append(include_path.getPath(b)); + try zig_args.appendSlice(&.{ "-isystem", include_path.getPath2(b, asking_step) }); }, .path_after => |include_path| { - try zig_args.append("-idirafter"); - try zig_args.append(include_path.getPath(b)); + try zig_args.appendSlice(&.{ "-idirafter", include_path.getPath2(b, asking_step) }); }, .framework_path => |include_path| { - try zig_args.append("-F"); - try zig_args.append(include_path.getPath2(b, asking_step)); + try zig_args.appendSlice(&.{ "-F", include_path.getPath2(b, asking_step) }); }, .framework_path_system => |include_path| { - try zig_args.append("-iframework"); - try zig_args.append(include_path.getPath2(b, asking_step)); + try zig_args.appendSlice(&.{ "-iframework", include_path.getPath2(b, asking_step) }); }, .other_step => |other| { if (other.generated_h) |header| { |
