mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-12 08:21:02 +02:00
Make UWP dependencies self contained
This commit is contained in:
+22
-65
@@ -5,10 +5,10 @@ This is the Xbox Dev Mode package for Gen1Recomp.
|
||||
The rough shape is:
|
||||
|
||||
- `Gen1RecompUWP.exe` starts LÖVE through SDL's WinRT wrapper
|
||||
- [love-xbox-uwp](https://github.com/caorthann-celt/love-xbox-uwp) provides the LÖVE 11.5 UWP backend and LuaJIT
|
||||
- SDL2 is built from the copy already carried by Gen1Recomp
|
||||
- the bundled LÖVE 11.5 UWP backend provides LuaJIT and the Xbox file picker
|
||||
- the bundled SDL2 runtime contains the Xbox controller mapping
|
||||
- ANGLE provides OpenGL ES over D3D11
|
||||
- vcpkg provides the audio, font, video, and compression libraries
|
||||
- the bundled runtime contains the audio, font, video, and compression libraries
|
||||
|
||||
## What You Need
|
||||
|
||||
@@ -20,83 +20,40 @@ The tested toolchain is:
|
||||
- Windows 11 SDK `10.0.26100.0`
|
||||
- CMake 3.24 or newer
|
||||
- Git
|
||||
- vcpkg with the `x64-uwp` triplet
|
||||
|
||||
Use Visual Studio Installer to add **Universal Windows Platform development**, the v143 C++ tools, CMake tools for Windows, and Windows SDK `10.0.26100.0`.
|
||||
|
||||
## Checkouts
|
||||
The x64 UWP dependencies are committed under `third_party`. Their versions,
|
||||
source revisions, licences, and hashes are recorded in `third_party/manifest.json`.
|
||||
No additional checkout or environment variable is required for a normal game
|
||||
build.
|
||||
|
||||
Keep the game, LÖVE backend, and vcpkg in separate folders. From the parent of the existing Gen1Recomp checkout:
|
||||
## Rebuild the Dependencies
|
||||
|
||||
Run the dependency rebuild from `ports/uwp`:
|
||||
|
||||
```powershell
|
||||
git clone --branch gen1recomp --single-branch `
|
||||
https://github.com/caorthann-celt/love-xbox-uwp.git `
|
||||
love-xbox-uwp
|
||||
git clone https://github.com/microsoft/vcpkg.git vcpkg
|
||||
.\scripts\rebuild-dependencies.ps1
|
||||
```
|
||||
|
||||
The LÖVE checkout must stay on the `gen1recomp` branch.
|
||||
The script clones the pinned SDL2, LÖVE, LuaJIT, vcpkg, depot_tools, and ANGLE
|
||||
sources when they are missing. It applies the Xbox SDL2 patch, builds the x64
|
||||
UWP Release libraries, stages the required DLLs, import libraries, headers, and
|
||||
licences under `third_party`, updates every SHA-256 entry in the manifest, then
|
||||
builds the Release MSIX.
|
||||
|
||||
## vcpkg
|
||||
|
||||
Bootstrap vcpkg and install the UWP libraries used by LÖVE:
|
||||
|
||||
```powershell
|
||||
Set-Location vcpkg
|
||||
./bootstrap-vcpkg.bat
|
||||
./vcpkg.exe install `
|
||||
freetype:x64-uwp `
|
||||
openal-soft:x64-uwp `
|
||||
libtheora:x64-uwp `
|
||||
libvorbis:x64-uwp `
|
||||
libogg:x64-uwp `
|
||||
zlib:x64-uwp
|
||||
Set-Location ..
|
||||
```
|
||||
|
||||
## Environment
|
||||
|
||||
Set the three build roots from the parent folder:
|
||||
|
||||
```powershell
|
||||
$env:LOVE_UWP_ROOT = (Resolve-Path './love-xbox-uwp').Path
|
||||
$env:VCPKG_ROOT = (Resolve-Path './vcpkg').Path
|
||||
$gameRoot = (Resolve-Path './Gen1Recomp-UWP').Path
|
||||
```
|
||||
|
||||
## Build SDL2
|
||||
|
||||
Start from a Visual Studio 2022 UWP developer prompt, or initialize `VsDevCmd.bat` for x64 UWP. Then build and install SDL2:
|
||||
|
||||
```powershell
|
||||
Set-Location "$gameRoot\ports\uwp"
|
||||
./scripts/build-sdl2-angle.ps1
|
||||
$env:UWP_SDL2_ANGLE_ROOT = (Resolve-Path './build/sdl2-install').Path
|
||||
```
|
||||
|
||||
## Build LÖVE
|
||||
|
||||
Configure the backend once, then build the Release libraries and DLLs:
|
||||
|
||||
```powershell
|
||||
cmake -S $env:LOVE_UWP_ROOT -B "$env:LOVE_UWP_ROOT/build/uwp-x64-angle" `
|
||||
-G "Visual Studio 17 2022" -A x64 `
|
||||
-DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 `
|
||||
"-DCMAKE_TOOLCHAIN_FILE=$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" `
|
||||
-DVCPKG_TARGET_TRIPLET=x64-uwp `
|
||||
"-DLOVE_UWP_SDL_ROOT=$env:UWP_SDL2_ANGLE_ROOT" `
|
||||
-DLOVE_UWP_LUAJIT=ON -DLOVE_UWP_ANGLE=ON
|
||||
|
||||
cmake --build "$env:LOVE_UWP_ROOT/build/uwp-x64-angle" `
|
||||
--config Release --parallel
|
||||
```
|
||||
The generated source checkouts are ignored by Git. A fresh ANGLE sync is about
|
||||
10 GB, so allow at least 20 GB of free disk space for all sources and build
|
||||
outputs. Use `-SkipAngle` to retain the existing pinned ANGLE runtime while
|
||||
rebuilding SDL2, LÖVE, LuaJIT, and the vcpkg libraries. Use `-SkipPackage` when
|
||||
only the dependency bundle needs to be refreshed.
|
||||
|
||||
## Build the MSIX
|
||||
|
||||
Build the game package from `ports/uwp`:
|
||||
|
||||
```powershell
|
||||
Set-Location "$gameRoot\ports\uwp"
|
||||
Set-Location "ports\uwp"
|
||||
cmake --preset uwp-release
|
||||
cmake --build --preset uwp-release
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user