Skip to content

Instantly share code, notes, and snippets.

@radical
Created March 19, 2021 19:58
Show Gist options
  • Save radical/26bb1acc069ad6156b1dd8e3bc7dd561 to your computer and use it in GitHub Desktop.
Save radical/26bb1acc069ad6156b1dd8e3bc7dd561 to your computer and use it in GitHub Desktop.
  1. 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" />

  1. 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>
  1. dotnet restore
  2. 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"
  1. Now you should be able to run emcc --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment