From a0b03d7ffffdf89b14ad6f1d5cd6537935996338 Mon Sep 17 00:00:00 2001 From: mlugg Date: Tue, 20 Aug 2024 21:04:42 +0100 Subject: std.Build.Step.TranslateC: propagate target, optimize, link_libc to created module --- lib/std/Build/Step/TranslateC.zig | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/std/Build/Step') diff --git a/lib/std/Build/Step/TranslateC.zig b/lib/std/Build/Step/TranslateC.zig index 77fd3e39ad..9ef5f7acdf 100644 --- a/lib/std/Build/Step/TranslateC.zig +++ b/lib/std/Build/Step/TranslateC.zig @@ -29,7 +29,7 @@ pub const Options = struct { pub fn create(owner: *std.Build, options: Options) *TranslateC { const translate_c = owner.allocator.create(TranslateC) catch @panic("OOM"); const source = options.root_source_file.dupe(owner); - translate_c.* = TranslateC{ + translate_c.* = .{ .step = Step.init(.{ .id = base_id, .name = "translate-c", @@ -42,7 +42,7 @@ pub fn create(owner: *std.Build, options: Options) *TranslateC { .out_basename = undefined, .target = options.target, .optimize = options.optimize, - .output_file = std.Build.GeneratedFile{ .step = &translate_c.step }, + .output_file = .{ .step = &translate_c.step }, .link_libc = options.link_libc, .use_clang = options.use_clang, }; @@ -89,6 +89,9 @@ pub fn addModule(translate_c: *TranslateC, name: []const u8) *std.Build.Module { pub fn createModule(translate_c: *TranslateC) *std.Build.Module { return translate_c.step.owner.createModule(.{ .root_source_file = translate_c.getOutput(), + .target = translate_c.target, + .optimize = translate_c.optimize, + .link_libc = translate_c.link_libc, }); } -- cgit v1.2.3