commit a0b03d7ffffdf89b14ad6f1d5cd6537935996338 (tree)
parent 4f437e4d2450dd2aca719ec0dcafa5aed141ca01
Author: mlugg <mlugg@mlugg.co.uk>
Date: Tue, 20 Aug 2024 21:04:42 +0100
std.Build.Step.TranslateC: propagate target, optimize, link_libc to created module
Diffstat:
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git 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,
});
}