Skip to content

Commit c3a8fee

Browse files
committed
Add target to add required native content and set EmccFlags
1 parent e95e557 commit c3a8fee

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

WebGPUGen/Evergine.Bindings.WebGPU/Evergine.Bindings.WebGPU.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
</PropertyGroup>
2020

2121
<ItemGroup>
22-
<Content Include="runtimes\**" PackagePath="runtimes" Pack="true" />
22+
<Content Include="buildtransitive\**" PackagePath="build" Visible="true" />
23+
<Content Include="runtimes\**" PackagePath="runtimes" Pack="true" />
2324
</ItemGroup>
2425

2526
<ItemGroup>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<PropertyGroup Condition="$(RuntimeIdentifier) == 'browser-wasm'">
3+
<EmccFlags>-s USE_WEBGPU $(ExtraEmccFlags)</EmccFlags>
4+
</PropertyGroup>
5+
<ItemGroup>
6+
<NativeFileReference Include="$(MSBuildThisFileDirectory)..\runtimes\browser-wasm\wgpu_native.c" ScanForPInvokes="true" />
7+
</ItemGroup>
8+
</Project>

WebGPUGen/HelloTriangleWasm/HelloTriangleWasm.csproj

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,13 @@
44
<TargetFramework>net8.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
7-
<EmccFlags>-s USE_WEBGPU</EmccFlags>
87
<!-- Required in order to take EmccFlags into account -->
98
<WasmBuildNative>true</WasmBuildNative>
109
<WasmAllowUndefinedSymbols>true</WasmAllowUndefinedSymbols>
1110
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1211
</PropertyGroup>
1312

14-
<ItemGroup>
15-
<NativeFileReference Include="..\Evergine.Bindings.WebGPU\runtimes\browser-wasm\wgpu_native.c" />
16-
</ItemGroup>
17-
18-
<ItemGroup>
13+
<ItemGroup>
1914
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.16" />
2015
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.16" PrivateAssets="all" />
2116
</ItemGroup>
@@ -24,4 +19,6 @@
2419
<ProjectReference Include="..\Evergine.Bindings.WebGPU\Evergine.Bindings.WebGPU.csproj" />
2520
</ItemGroup>
2621

22+
<Import Project="..\Evergine.Bindings.WebGPU\buildtransitive\Evergine.Bindings.WebGPU.targets" />
23+
2724
</Project>

0 commit comments

Comments
 (0)