add zig-js

This commit is contained in:
Mitchell Hashimoto
2022-12-03 21:46:00 -08:00
parent fc618d37b2
commit 21faf0b6fb
3 changed files with 10 additions and 0 deletions

3
.gitmodules vendored
View File

@ -34,3 +34,6 @@
[submodule "vendor/pixman"]
path = vendor/pixman
url = https://github.com/freedesktop/pixman.git
[submodule "vendor/zig-js"]
path = vendor/zig-js
url = https://github.com/mitchellh/zig-js.git

View File

@ -7,6 +7,7 @@ const fontconfig = @import("pkg/fontconfig/build.zig");
const freetype = @import("pkg/freetype/build.zig");
const harfbuzz = @import("pkg/harfbuzz/build.zig");
const imgui = @import("pkg/imgui/build.zig");
const js = @import("vendor/zig-js/build.zig");
const libxml2 = @import("vendor/zig-libxml2/libxml2.zig");
const libuv = @import("pkg/libuv/build.zig");
const libpng = @import("pkg/libpng/build.zig");
@ -235,6 +236,11 @@ fn addDeps(
_ = try macos.link(b, step, .{});
}
// Wasm
if (step.target.getCpuArch() == .wasm32) {
step.addPackage(js.pkg);
}
// We always statically compile glad
step.addIncludePath("vendor/glad/include/");
step.addCSourceFile("vendor/glad/src/gl.c", &.{});

1
vendor/zig-js vendored Submodule

@ -0,0 +1 @@
Subproject commit a6d0b5a0c421925409f1bce542f64b9e5f6b96df