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 {...@@ -29,7 +29,7 @@ pub const Options = struct {
29pub fn create(owner: *std.Build, options: Options) *TranslateC {29pub fn create(owner: *std.Build, options: Options) *TranslateC {
30 const translate_c = owner.allocator.create(TranslateC) catch @panic("OOM");30 const translate_c = owner.allocator.create(TranslateC) catch @panic("OOM");
31 const source = options.root_source_file.dupe(owner);31 const source = options.root_source_file.dupe(owner);
32 translate_c.* = TranslateC{32 translate_c.* = .{
33 .step = Step.init(.{33 .step = Step.init(.{
34 .id = base_id,34 .id = base_id,
35 .name = "translate-c",35 .name = "translate-c",
...@@ -42,7 +42,7 @@ pub fn create(owner: *std.Build, options: Options) *TranslateC {...@@ -42,7 +42,7 @@ pub fn create(owner: *std.Build, options: Options) *TranslateC {
42 .out_basename = undefined,42 .out_basename = undefined,
43 .target = options.target,43 .target = options.target,
44 .optimize = options.optimize,44 .optimize = options.optimize,
45 .output_file = std.Build.GeneratedFile{ .step = &translate_c.step },45 .output_file = .{ .step = &translate_c.step },
46 .link_libc = options.link_libc,46 .link_libc = options.link_libc,
47 .use_clang = options.use_clang,47 .use_clang = options.use_clang,
48 };48 };
...@@ -89,6 +89,9 @@ pub fn addModule(translate_c: *TranslateC, name: []const u8) *std.Build.Module {...@@ -89,6 +89,9 @@ pub fn addModule(translate_c: *TranslateC, name: []const u8) *std.Build.Module {
89pub fn createModule(translate_c: *TranslateC) *std.Build.Module {89pub fn createModule(translate_c: *TranslateC) *std.Build.Module {
90 return translate_c.step.owner.createModule(.{90 return translate_c.step.owner.createModule(.{
91 .root_source_file = translate_c.getOutput(),91 .root_source_file = translate_c.getOutput(),
92 .target = translate_c.target,
93 .optimize = translate_c.optimize,
94 .link_libc = translate_c.link_libc,
92 });95 });
93}96}
9497