-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexport.ps1
More file actions
37 lines (31 loc) · 1.64 KB
/
Copy pathexport.ps1
File metadata and controls
37 lines (31 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Convenience wrapper for the CUDA / no-CUDA build profiles (see
# Directory.Build.targets). Usage:
# .\export.ps1 linux # with CUDA (default)
# .\export.ps1 linux -no-cuda
# .\export.ps1 windows
# .\export.ps1 windows -no-cuda
# .\export.ps1 macos # -no-cuda accepted but ignored: no CUDA
# # backend exists for macOS either way
param(
[Parameter(Mandatory = $true, Position = 0)]
[ValidateSet("linux", "windows", "macos")]
[string]$Platform,
# PowerShell parameter names can't contain hyphens themselves -- this
# alias is what makes -no-cuda work, to match export.sh's --no-cuda.
[Alias("no-cuda")]
[switch]$NoCuda
)
$ErrorActionPreference = "Stop"
$cuda = -not $NoCuda
switch ("$Platform-$cuda") {
"linux-True" { $preset = "Linux x64"; $out = "Export/Linux_x64/SharpCompanion.x86_64" }
"linux-False" { $preset = "Linux x64"; $out = "Export/Linux_x64_nocuda/SharpCompanion.x86_64" }
"windows-True" { $preset = "Windows Desktop x64"; $out = "Export/Windows_x64/SharpCompanion.exe" }
"windows-False" { $preset = "Windows Desktop x64"; $out = "Export/Windows_x64_nocuda/SharpCompanion.exe" }
"macos-True" { $preset = "macOS"; $out = "Export/MacOS/SharpCompanion.app" }
"macos-False" { $preset = "macOS"; $out = "Export/MacOS/SharpCompanion.app" }
}
New-Item -ItemType Directory -Force -Path (Split-Path $out) | Out-Null
# Adjust this if your Godot .NET editor binary isn't on PATH as "godot-mono".
$env:IncludeCuda = $cuda.ToString().ToLower()
godot-mono --headless --export-release $preset $out