Skip to content

Commit

Permalink
Merge pull request #65 from jsturtevant/fix-readme
Browse files Browse the repository at this point in the history
Fix up readme so instructions work
  • Loading branch information
jsturtevant authored Jan 9, 2025
2 parents b40baa3 + d21b5e4 commit f09f703
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 f09f703

Please sign in to comment.