mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-03 20:03:50 +00:00
feat: add multi-platform Docker build system for Linux, macOS, and Windows
Replace the single Ubuntu-based container build with a dedicated Dockerfile, build script, and launcher for each target platform. Infrastructure: - Add .dockerignore to minimize Docker build context - Add container/builder-linux.Dockerfile (Ubuntu 24.04, GCC, native build) - Add container/builder-macos.Dockerfile (multi-stage: SDK fetcher + osxcross/Clang 18) - Add container/builder-windows.Dockerfile (LLVM-MinGW 20240619, vcpkg) - Add container/macos/sdk-fetcher.py (auto-fetch macOS SDK from Apple catalog) - Add container/macos/osxcross-toolchain.cmake (auto-detecting CMake toolchain) - Add container/macos/triplets/arm64-osx-cross.cmake - Add container/macos/triplets/x64-osx-cross.cmake - Remove container/builder-ubuntu.Dockerfile (replaced by per-platform Dockerfiles) - Remove container/build-in-container.sh and container/build-wowee.sh (replaced) Build scripts (run inside containers): - Add container/build-linux.sh (tar copy, FidelityFX clone, cmake/ninja) - Add container/build-macos.sh (arch detection, vcpkg triplet, cross-compile) - Add container/build-windows.sh (Vulkan import lib via dlltool, cross-compile) Launcher scripts (run on host): - Add container/run-linux.sh, run-macos.sh, run-windows.sh (bash) - Add container/run-linux.ps1, run-macos.ps1, run-windows.ps1 (PowerShell) Documentation: - Add container/README.md (quick start, options, file structure, troubleshooting) - Add container/FLOW.md (comprehensive build flow for each platform) CMake changes: - Add macOS cross-compile support (VulkanHeaders, -undefined dynamic_lookup) - Add LLVM-MinGW/Windows cross-compile support - Detect osxcross toolchain and vcpkg triplets Other: - Update vcpkg.json with ffmpeg feature flags - Update resources/wowee.rc version string
This commit is contained in:
parent
c1c28d4216
commit
85f8d05061
25 changed files with 1881 additions and 74 deletions
71
container/run-macos.ps1
Normal file
71
container/run-macos.ps1
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
# run-macos.ps1 — Cross-compile WoWee for macOS (arm64 or x86_64) inside a Docker container.
|
||||
#
|
||||
# Usage (run from project root):
|
||||
# .\container\run-macos.ps1 [-RebuildImage] [-Arch arm64|x86_64]
|
||||
#
|
||||
# The macOS SDK is fetched automatically inside the Docker build from Apple's
|
||||
# public software update catalog. No manual SDK download required.
|
||||
#
|
||||
# Environment variables:
|
||||
# WOWEE_FFX_SDK_REPO — FidelityFX SDK git repo URL (passed through to container)
|
||||
# WOWEE_FFX_SDK_REF — FidelityFX SDK git ref / tag (passed through to container)
|
||||
|
||||
param(
|
||||
[switch]$RebuildImage,
|
||||
[ValidateSet("arm64", "x86_64")]
|
||||
[string]$Arch = "arm64"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
|
||||
$ProjectRoot = (Resolve-Path "$ScriptDir\..").Path
|
||||
|
||||
$ImageName = "wowee-builder-macos"
|
||||
$BuildOutput = "$ProjectRoot\build\macos"
|
||||
|
||||
# Verify Docker is available
|
||||
if (-not (Get-Command docker -ErrorAction SilentlyContinue)) {
|
||||
Write-Error "docker is not installed or not in PATH."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Build the image (skip if already present and -RebuildImage not given)
|
||||
$imageExists = docker image inspect $ImageName 2>$null
|
||||
if ($RebuildImage -or -not $imageExists) {
|
||||
Write-Host "==> Building Docker image: $ImageName"
|
||||
Write-Host " (SDK will be fetched automatically from Apple's catalog)"
|
||||
docker build `
|
||||
-f "$ScriptDir\builder-macos.Dockerfile" `
|
||||
-t $ImageName `
|
||||
"$ScriptDir"
|
||||
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
||||
} else {
|
||||
Write-Host "==> Using existing Docker image: $ImageName"
|
||||
}
|
||||
|
||||
# Create output directory on the host
|
||||
New-Item -ItemType Directory -Force -Path $BuildOutput | Out-Null
|
||||
|
||||
Write-Host "==> Starting macOS cross-compile build (arch=$Arch, output: $BuildOutput)"
|
||||
|
||||
$dockerArgs = @(
|
||||
"run", "--rm",
|
||||
"--mount", "type=bind,src=$ProjectRoot,dst=/src,readonly",
|
||||
"--mount", "type=bind,src=$BuildOutput,dst=/out",
|
||||
"--env", "MACOS_ARCH=$Arch"
|
||||
)
|
||||
|
||||
if ($env:WOWEE_FFX_SDK_REPO) {
|
||||
$dockerArgs += @("--env", "WOWEE_FFX_SDK_REPO=$env:WOWEE_FFX_SDK_REPO")
|
||||
}
|
||||
if ($env:WOWEE_FFX_SDK_REF) {
|
||||
$dockerArgs += @("--env", "WOWEE_FFX_SDK_REF=$env:WOWEE_FFX_SDK_REF")
|
||||
}
|
||||
|
||||
$dockerArgs += $ImageName
|
||||
|
||||
& docker @dockerArgs
|
||||
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
||||
|
||||
Write-Host "==> macOS cross-compile build complete. Artifacts in: $BuildOutput"
|
||||
Loading…
Add table
Add a link
Reference in a new issue