@@ -3,6 +3,7 @@ const std = @import("std");
33const Build = std .Build ;
44pub const Language = lua_setup .Language ;
55const Step = std .Build .Step ;
6+ const Translator = @import ("translate_c" ).Translator ;
67
78const lua_setup = @import ("build/lua.zig" );
89const luau_setup = @import ("build/luau.zig" );
@@ -96,22 +97,22 @@ pub fn build(b: *Build) void {
9697 .luau = > b .path ("build/include/luau_all.h" ),
9798 else = > b .path ("build/include/lua_all.h" ),
9899 };
99- const c_headers = b .addTranslateC (.{
100- .root_source_file = c_header_path ,
100+ const translate_c = b .dependency ("translate_c" , .{});
101+
102+ const t : Translator = .init (translate_c , .{
103+ .c_source_file = c_header_path ,
101104 .target = target ,
102105 .optimize = optimize ,
103106 });
104- c_headers .addIncludePath (lib .getEmittedIncludeTree ());
107+ t .addIncludePath (lib .getEmittedIncludeTree ());
105108
106109 // If we've been given additional system headers, add them now
107110 // Useful for things like linking Emscripten headers by including a new sysroot
108111 if (additional_system_headers != null ) {
109- c_headers .addSystemIncludePath (additional_system_headers .? );
112+ t .addSystemIncludePath (additional_system_headers .? );
110113 }
111114
112- c_headers .step .dependOn (& install_lib .step );
113-
114- const ziglua_c = c_headers .createModule ();
115+ const ziglua_c = t .mod ;
115116 b .modules .put (b .graph .arena , "ziglua-c" , ziglua_c ) catch @panic ("OOM" );
116117
117118 zlua .addImport ("c" , ziglua_c );
0 commit comments