mirror of
https://github.com/ziglang/zig.git
synced 2025-02-01 14:55:08 +00:00
std.Build.Step.TranslateC: propagate target, optimize, link_libc to created module
This commit is contained in:
parent
4f437e4d24
commit
a0b03d7fff
@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user