Skip to content

Commit

Permalink
zig: make emsdk optional dependency
Browse files Browse the repository at this point in the history
ref: #47
  • Loading branch information
kassane committed Jan 7, 2025
1 parent 3332ca6 commit 433bff9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,11 @@ pub fn build(b: *Build) !void {
const target = b.standardTargetOptions(.{ .default_target = if (builtin.os.tag == .windows) try std.Target.Query.parse(.{ .arch_os_abi = "native-windows-msvc" }) else .{} });
const optimize = b.standardOptimizeOption(.{});

const emsdk = b.lazyDependency("emsdk", .{}) orelse null;
// Get emsdk dependency if targeting WebAssembly, otherwise null
const emsdk = if (target.result.isWasm())
b.dependency("emsdk", .{})
else
null;
const lib_sokol = try buildLibSokol(b, .{
.target = target,
.optimize = optimize,
Expand Down

0 comments on commit 433bff9

Please sign in to comment.