- Make sure you have dotnet6 added to your feed, so add this to nuget.config:
<add key="dotnet6" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" />
- Add these package references to the project
<ItemGroup>
<PackageReference Include="Microsoft.NET.Runtime.Emscripten.2.0.12.Node.osx-x64" Version="6.0.0-preview.3.21169.6" />
<PackageReference Include="Microsoft.NET.Runtime.Emscripten.2.0.12.Python.osx-x64" Version="6.0.0-preview.3.21169.6" />
<PackageReference Include="Microsoft.NET.Runtime.Emscripten.2.0.12.Sdk.osx-x64" Version="6.0.0-preview.3.21169.6" />
</ItemGroup>
dotnet restore
- set:
EM_VERSION=6.0.0-preview.3.21169.6
export DOTNET_EMSCRIPTEN_LLVM_ROOT=$HOME/.nuget/packages/microsoft.net.runtime.emscripten.2.0.12.sdk.osx-x64/$EM_VERSION/tools/bin
export DOTNET_EMSCRIPTEN_BINARYEN_ROOT=$HOME/.nuget/packages/microsoft.net.runtime.emscripten.2.0.12.sdk.osx-x64/$EM_VERSION/tools
export DOTNET_EMSCRIPTEN_NODE_JS=$HOME/.nuget/packages/microsoft.net.runtime.emscripten.2.0.12.node.osx-x64/$EM_VERSION/tools/bin/node
export PATH="$HOME/.nuget/packages/microsoft.net.runtime.emscripten.2.0.12.python.osx-x64/$EM_VERSION/tools/bin:$HOME/.nuget/packages/microsoft.net.runtime.emscripten.2.0.12.sdk.osx-x64/$EM_VERSION/tools/emscripten:$PATH"
- Now you should be able to run
emcc --version