Skip to content

Commit

Permalink
build: update AOT single file conditions in csproj
Browse files Browse the repository at this point in the history
  • Loading branch information
RokyZevon committed Apr 26, 2024
1 parent e51ce0c commit fc494e7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ If any Mods are changed later, please re-click `Mod it`

SDK: .NET 8.0

- If you don't need AOT single file, you can directly run `dotnet publish`, which will generate 3 additional dll files under `publish`
- If you don't need AOT single file, you need to change `<PublishAotSingleFile>` to `false` in `RelinkModOrganizer.csproj`.
Then run `dotnet publish`, which will generate 3 additional dll files under `publish`

- If you want to build into a single AOT executable, you need to download the static libraries from [SkiaSharp.Static](https://github.com/2ndlab/SkiaSharp.Static) and [ANGLE.Static](https://github.com/2ndlab/ANGLE.Static), and put them into `Natives/Windows-x64` folder.
After `dotnet publish` is done, you can safely delete the .dll files
Expand Down
9 changes: 6 additions & 3 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@

SDK: .NET 8.0

- 如不需要 AOT 单文件, 可直接运行 `dotnet publish`, 这样会在 `publish` 下生成 3 个额外的 dll 文件
- 如需构建成单个 AOT 可执行文件, 需从 [SkiaSharp.Static](https://github.com/2ndlab/SkiaSharp.Static)[ANGLE.Static](https://github.com/2ndlab/ANGLE.Static) 下载相应的静态库, 并将其放在 `Natives/Windows-x64` 文件夹下, 然后运行 `dotnet publish`. 之后可以安全地删除上述 .dll 文件
- 如不需要 AOT 单文件, 需先将 `RelinkModOrganizer.csproj` 中的 `<PublishAotSingleFile>` 设置为 `false`.
运行 `dotnet publish`, 这样会在 `publish` 下生成 3 个额外的 dll 文件

- 如需构建成单个 AOT 可执行文件, 需从 [SkiaSharp.Static](https://github.com/2ndlab/SkiaSharp.Static)[ANGLE.Static](https://github.com/2ndlab/ANGLE.Static) 下载相应的静态库, 并将其放在 `Natives/Windows-x64` 文件夹下.
运行 `dotnet publish`, 之后可以安全地删除上述 .dll 文件

## 致谢

Modding 的核心逻辑来自于 [gbfrelink.utility.manager](https://github.com/WistfulHopes/gbfrelink.utility.manager), 感谢他们的付出!
Modding 的核心逻辑来自于 [gbfrelink.utility.manager](https://github.com/WistfulHopes/gbfrelink.utility.manager), 感谢他们的杰出成果!
8 changes: 4 additions & 4 deletions RelinkModOrganizer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@
</ItemGroup>

<!-- AOT single file -->
<ItemGroup Label="AotSingleFile" Condition="'$(Configuration)' != 'Debug' AND '$(PublishAot)' == 'true' AND '$(PublishAotSingleFile)' == 'true'">
<ItemGroup Label="AotSingleFile" Condition="$(RuntimeIdentifier.StartsWith('win')) AND '$(Configuration)' != 'Debug' AND '$(PublishAot)' == 'true' AND '$(PublishAotSingleFile)' == 'true'">
<DirectPInvoke Include="libHarfBuzzSharp" />
<NativeLibrary Include="Natives/Windows-x64/libHarfBuzzSharp.lib" Condition="$(RuntimeIdentifier.StartsWith('win'))" />
<NativeLibrary Include="Natives/Windows-x64/libHarfBuzzSharp.lib" />

<DirectPInvoke Include="libSkiaSharp" />
<NativeLibrary Include="Natives/Windows-x64/libSkiaSharp.lib" Condition="$(RuntimeIdentifier.StartsWith('win'))" />
<NativeLibrary Include="Natives/Windows-x64/libSkiaSharp.lib" />

<DirectPInvoke Include="av_libglesv2" />
<NativeLibrary Include="Natives/Windows-x64/av_libglesv2.lib" Condition="$(RuntimeIdentifier.StartsWith('win'))" />
<NativeLibrary Include="Natives/Windows-x64/av_libglesv2.lib" />

<Content Update="*.dll" CopyToPublishDirectory="Never" />
</ItemGroup>
Expand Down

0 comments on commit fc494e7

Please sign in to comment.