mach: fix building for wasm32 target

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2023-04-25 15:05:37 -07:00 committed by Stephen Gutekanst
parent 142c8b5b2e
commit 9c14e617c9

View file

@ -55,6 +55,13 @@ pub fn build(b: *std.Build) !void {
const optimize = b.standardOptimizeOption(.{});
const target = b.standardTargetOptions(.{});
const gpu_dawn_options = gpu_dawn.Options{
.from_source = b.option(bool, "dawn-from-source", "Build Dawn from source") orelse false,
.debug = b.option(bool, "dawn-debug", "Use a debug build of Dawn") orelse false,
};
const options = Options{ .core = .{ .gpu_dawn_options = gpu_dawn_options } };
if (target.getCpuArch() != .wasm32) {
const app = b.addExecutable(.{
.name = "mach",
.root_source_file = .{ .path = "app/main.zig" },
@ -71,13 +78,6 @@ pub fn build(b: *std.Build) !void {
const app_run_step = b.step("run", "Run Mach Engine Application");
app_run_step.dependOn(&app_run_cmd.step);
const gpu_dawn_options = gpu_dawn.Options{
.from_source = b.option(bool, "dawn-from-source", "Build Dawn from source") orelse false,
.debug = b.option(bool, "dawn-debug", "Use a debug build of Dawn") orelse false,
};
const options = Options{ .core = .{ .gpu_dawn_options = gpu_dawn_options } };
if (target.getCpuArch() != .wasm32) {
const all_tests_step = b.step("test", "Run library tests");
const core_test_step = b.step("test-core", "Run Core library tests");
const ecs_test_step = b.step("test-ecs", "Run ECS library tests");