From cf319876e6d558edbbb8c3600f180468cfb49f62 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Sat, 18 Apr 2026 19:55:37 +0200 Subject: [PATCH] Fix build error on missing Emscripten SDK to be more usable --- .../GraphicsDevice/WebGPU/GraphicsDeviceWebGPU.Build.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Engine/GraphicsDevice/WebGPU/GraphicsDeviceWebGPU.Build.cs b/Source/Engine/GraphicsDevice/WebGPU/GraphicsDeviceWebGPU.Build.cs index 0a56770a4..59c241664 100644 --- a/Source/Engine/GraphicsDevice/WebGPU/GraphicsDeviceWebGPU.Build.cs +++ b/Source/Engine/GraphicsDevice/WebGPU/GraphicsDeviceWebGPU.Build.cs @@ -1,5 +1,6 @@ // Copyright (c) Wojciech Figat. All rights reserved. +using System; using System.IO; using Flax.Build.NativeCpp; using Flax.Build.Platforms; @@ -23,6 +24,9 @@ public class GraphicsDeviceWebGPU : GraphicsDeviceBaseModule { base.Setup(options); + if (!EmscriptenSdk.Instance.IsValid) + throw new Exception("Cannot build WebGPU for Web without Emscripten SDK. Check environment variable 'EMSDK'."); + var port = "--use-port=emdawnwebgpu:cpp_bindings=false"; options.OutputFiles.Add(port); options.CompileEnv.CustomArgs.Add(port);