authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2024-08-20 21:04:42+01:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2024-08-21 19:13:26+01:00
loga0b03d7ffffdf89b14ad6f1d5cd6537935996338
tree9a25388910f75228d1ccec53da19a1ef803c8115
parent4f437e4d2450dd2aca719ec0dcafa5aed141ca01
signaturelock-open Commit is signed but in an unrecognized format.

std.Build.Step.TranslateC: propagate target, optimize, link_libc to created module


1 files changed, 5 insertions(+), 2 deletions(-)

lib/std/Build/Step/TranslateC.zig+5-2
......@@ -29,7 +29,7 @@ pub const Options = struct {
2929pub fn create(owner: *std.Build, options: Options) *TranslateC {
3030 const translate_c = owner.allocator.create(TranslateC) catch @panic("OOM");
3131 const source = options.root_source_file.dupe(owner);
32 translate_c.* = TranslateC{
32 translate_c.* = .{
3333 .step = Step.init(.{
3434 .id = base_id,
3535 .name = "translate-c",
......@@ -42,7 +42,7 @@ pub fn create(owner: *std.Build, options: Options) *TranslateC {
4242 .out_basename = undefined,
4343 .target = options.target,
4444 .optimize = options.optimize,
45 .output_file = std.Build.GeneratedFile{ .step = &translate_c.step },
45 .output_file = .{ .step = &translate_c.step },
4646 .link_libc = options.link_libc,
4747 .use_clang = options.use_clang,
4848 };
......@@ -89,6 +89,9 @@ pub fn addModule(translate_c: *TranslateC, name: []const u8) *std.Build.Module {
8989pub fn createModule(translate_c: *TranslateC) *std.Build.Module {
9090 return translate_c.step.owner.createModule(.{
9191 .root_source_file = translate_c.getOutput(),
92 .target = translate_c.target,
93 .optimize = translate_c.optimize,
94 .link_libc = translate_c.link_libc,
9295 });
9396}
9497