diff options
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -44,7 +44,14 @@ pub fn build(b: *Build) void { b.installArtifact(gltf_generator); // Target-free: they compile for whatever imports them, native or wasm. - const abi = b.addModule("abi", .{ .root_source_file = b.path("src/abi.zig") }); + // abi.hash's layout half, computed by a program once per change of the + // abi sources rather than at comptime in every sketch's compile. + const abi_hash = b.addRunArtifact(b.addExecutable(.{ .name = "abi-hash", .root_module = b.createModule(.{ + .root_source_file = b.path("src/abi_hash.zig"), + .target = b.graph.host, + .imports = &.{.{ .name = "abi", .module = b.createModule(.{ .root_source_file = b.path("src/abi.zig") }) }}, + }) })).captureStdOut(.{ .basename = "abi_hash.zig" }); + const abi = b.addModule("abi", .{ .root_source_file = b.path("src/abi.zig"), .imports = &.{.{ .name = "abi_hash", .module = b.createModule(.{ .root_source_file = abi_hash }) }} }); const gpu = b.addModule("gpu", .{ .root_source_file = b.path("src/gpu/Executor.zig"), .imports = &.{.{ .name = "abi", .module = abi }} }); _ = b.addModule("gpu_scene", .{ .root_source_file = b.path("src/gpu/scene.zig"), .imports = &.{.{ .name = "abi", .module = abi }} }); // Embedders provide their existing SDL translation and device. |
