Skip to content

Commit

Permalink
Fix up readme so instructions work
Browse files Browse the repository at this point in the history
Signed-off-by: James Sturtevant <[email protected]>
  • Loading branch information
jsturtevant committed Jan 8, 2025
1 parent b40baa3 commit d21b5e4
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,25 @@ Add the platform specific LLVM package:

```
## On Linux
dotnet add package runtime.linux-x64.microsoft.dotnet.ilcompiler.llvm --version 10.0.0-alpha.1.24573.1 --prerelease
dotnet add package runtime.linux-x64.microsoft.dotnet.ilcompiler.llvm --prerelease
## or
## On Windows
dotnet add package runtime.windows-x64.microsoft.dotnet.ilcompiler.llvm --version 10.0.0-alpha.1.24573.1 --prerelease
dotnet add package runtime.win-x64.microsoft.dotnet.ilcompiler.llvm --prerelease
```

Now you can `dotnet publish` to produce a `.wasm` file using NativeAOT compilation.
Edit the `.csproj` file, adding the following inside the `<PropertyGroup>`:

```
<RuntimeIdentifier>wasi-wasm</RuntimeIdentifier>
<UseAppHost>false</UseAppHost>
<PublishTrimmed>true</PublishTrimmed>
<InvariantGlobalization>true</InvariantGlobalization>
<SelfContained>true</SelfContained>
```

Now you can `dotnet build` to produce a `.wasm` file using NativeAOT compilation.

### 4. Run the WebAssembly binary

Expand Down

0 comments on commit d21b5e4

Please sign in to comment.