File tree 2 files changed +11
-5
lines changed
2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ pub fn build(b: *std.Build) !void {
29
29
const dep_ziglua = b .dependency ("ziglua" , .{
30
30
.target = target ,
31
31
.optimize = optimize ,
32
+ .lang = .lua54 ,
32
33
.can_use_jmp = ! target .result .isWasm (),
33
34
});
34
35
@@ -56,11 +57,6 @@ pub fn build(b: *std.Build) !void {
56
57
const cimgui_root = dep_cimgui .namedWriteFiles ("cimgui" ).getDirectory ();
57
58
dep_sokol .artifact ("sokol_clib" ).addIncludePath (cimgui_root );
58
59
59
- // C libraries need to depend on the sokol library to make sure the Emscripten SDK is setup first
60
- // when doing web builds
61
- dep_cimgui .artifact ("cimgui_clib" ).step .dependOn (& dep_sokol .artifact ("sokol_clib" ).step );
62
- dep_ziglua .artifact ("lua" ).step .dependOn (& dep_sokol .artifact ("sokol_clib" ).step );
63
-
64
60
const sokol_item = .{ .module = dep_sokol .module ("sokol" ), .name = "sokol" };
65
61
const ziglua_item = .{ .module = dep_ziglua .module ("ziglua" ), .name = "ziglua" };
66
62
const zmesh_item = .{ .module = dep_zmesh .module ("root" ), .name = "zmesh" };
@@ -102,6 +98,11 @@ pub fn build(b: *std.Build) !void {
102
98
}
103
99
104
100
for (build_collection .link_libraries ) | lib | {
101
+ if (target .result .isWasm ()) {
102
+ // ensure these libs all depend on the emcc C lib
103
+ lib .step .dependOn (& dep_sokol .artifact ("sokol_clib" ).step );
104
+ }
105
+
105
106
delve_mod .linkLibrary (lib );
106
107
}
107
108
Original file line number Diff line number Diff line change 14
14
.url = "git+https://github.com/interrupt/ziglua#3d7532ec73202bddfbeba1933d43fe427ca6d80d" ,
15
15
.hash = "12207a933b3cca4e301c711acbdb045a50c1d90f9525ab6544e409427b9672a6821f" ,
16
16
},
17
+ // needed because Lua is a lazy dependency inside of ziglua
18
+ .lua54 = .{
19
+ .url = "https://www.lua.org/ftp/lua-5.4.6.tar.gz" ,
20
+ .hash = "1220f93ada1fa077ab096bf88a5b159ad421dbf6a478edec78ddb186d0c21d3476d9" ,
21
+ },
17
22
.sokol = .{
18
23
.url = "git+https://github.com/floooh/sokol-zig.git#d3e21f76498213d6d58179065756f5f2ed9b90cf" ,
19
24
.hash = "122052a192829b377c637ce242ee8c9121e03d8cd10c889758dc6fb176368de7d67b" ,
You can’t perform that action at this time.
0 commit comments