54 lines
1.4 KiB
PowerShell
54 lines
1.4 KiB
PowerShell
# Cross-platform build script for Dimma (PowerShell)
|
|
# Builds Odin app + Go updater for all platforms
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
$PROJECT_DIR = Resolve-Path (Split-Path $PSScriptRoot -Parent)
|
|
$BUILD_DIR = "$PROJECT_DIR\build"
|
|
$ODIN_DIR = "$PROJECT_DIR\odin"
|
|
$GO_DIR = "$PROJECT_DIR\go"
|
|
|
|
New-Item -ItemType Directory -Force -Path $BUILD_DIR | Out-Null
|
|
|
|
# Build Go updater for all platforms
|
|
$GO_PLATFORMS = @(
|
|
@("linux", "amd64"),
|
|
@("linux", "arm64"),
|
|
@("darwin", "amd64"),
|
|
@("darwin", "arm64"),
|
|
@("windows", "amd64")
|
|
)
|
|
|
|
foreach ($platform in $GO_PLATFORMS) {
|
|
$os = $platform[0]
|
|
$arch = $platform[1]
|
|
Write-Host "Building Go updater for $os/$arch..."
|
|
Push-Location $GO_DIR
|
|
$env:GOOS = $os
|
|
$env:GOARCH = $arch
|
|
.\build.ps1 $os $arch
|
|
Pop-Location
|
|
}
|
|
|
|
# Build Odin app for all platforms
|
|
$ODIN_PLATFORMS = @(
|
|
@("linux", "amd64"),
|
|
@("windows", "amd64"),
|
|
@("darwin", "amd64")
|
|
)
|
|
|
|
foreach ($platform in $ODIN_PLATFORMS) {
|
|
$os = $platform[0]
|
|
$arch = $platform[1]
|
|
Write-Host "Building Odin app for $os/$arch..."
|
|
# odin build $ODIN_DIR\main.odin `
|
|
# -out:`$BUILD_DIR\dimma-$os-$arch.exe `
|
|
# -build-mode:exe `
|
|
# -target:. `
|
|
# -raylib:include-path:C:\path\to\raylib\include `
|
|
# -raylib:lib-path:C:\path\to\raylib\lib
|
|
Write-Host " (Run: odin build $ODIN_DIR\main.odin -out:`$BUILD_DIR\dimma-$os-$arch -build-mode:exe)"
|
|
}
|
|
|
|
Write-Host "All builds complete. Output in $BUILD_DIR"
|