Skip to content

Commit

Permalink
Prepare code to run in NativeAOT
Browse files Browse the repository at this point in the history
In order to publish using NativeAOT last change required is to target net7.0
CUrrently executable have size 99MB so I would not force that direction
  • Loading branch information
kant2002 committed Jun 18, 2022
1 parent d74d973 commit 71317a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions desktop/FSharpWolfenstein.Desktop.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PublishAot Condition="'$(TargetFramework)' == 'net7.0'">true</PublishAot>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -306,5 +307,6 @@
<PackageReference Include="Silk.NET.Windowing" Version="2.15.0" />
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.4" />
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="1.0.0-beta13" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="6.0.0" />
</ItemGroup>
</Project>
2 changes: 2 additions & 0 deletions desktop/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ let main _ =
let mutable options = WindowOptions.Default
options.Size <- Vector2D<int>(screenWidth * zoom,screenHeight * zoom)
options.Title <- "F# Wolfenstein"
Silk.NET.Input.Sdl.SdlInput.RegisterPlatform()
Silk.NET.Input.Glfw.GlfwInput.RegisterPlatform()
let window = Window.Create(options)
window.add_Load (load window)
window.add_Render render
Expand Down

0 comments on commit 71317a8

Please sign in to comment.