| ... | @@ -87,15 +87,9 @@ pub fn addModule(self: *TranslateC, name: []const u8) *std.Build.Module { | ... | @@ -87,15 +87,9 @@ pub fn addModule(self: *TranslateC, name: []const u8) *std.Build.Module { |
| 87 | /// current package, but not exposed to other packages depending on this one. | 87 | /// current package, but not exposed to other packages depending on this one. |
| 88 | /// `addModule` can be used instead to create a public module. | 88 | /// `addModule` can be used instead to create a public module. |
| 89 | pub fn createModule(self: *TranslateC) *std.Build.Module { | 89 | pub fn createModule(self: *TranslateC) *std.Build.Module { |
| 90 | const b = self.step.owner; | 90 | return self.step.owner.createModule(.{ |
| 91 | const module = b.allocator.create(std.Build.Module) catch @panic("OOM"); | | |
| 92 | | | |
| 93 | module.* = .{ | | |
| 94 | .builder = b, | | |
| 95 | .root_source_file = self.getOutput(), | 91 | .root_source_file = self.getOutput(), |
| 96 | .dependencies = std.StringArrayHashMap(*std.Build.Module).init(b.allocator), | 92 | }); |
| 97 | }; | | |
| 98 | return module; | | |
| 99 | } | 93 | } |
| 100 | | 94 | |
| 101 | pub fn addIncludeDir(self: *TranslateC, include_dir: []const u8) void { | 95 | pub fn addIncludeDir(self: *TranslateC, include_dir: []const u8) void { |