Skip to content

Commit f1b1706

Browse files
committed
informational (so far) addition: specify -UnrealRoot c:\path\to\unreal to locate an AutoSDK folder in the engine version, and enumerate which SDK versions it supplies scripts for.
This can be used for non-Windows platform support to determine the versions that Epic has supplied scripts for, so we can try to find one of those to install. Once we figure out how to detect or otherwise load them somewhere.
1 parent 1856feb commit f1b1706

File tree

1 file changed

+42
-1
lines changed

1 file changed

+42
-1
lines changed

Build-Unreal-AutoSDK.ps1

+42-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ param(
1515
[Parameter()] [switch] $OnlyWindowsSDK,
1616
[Parameter()] [switch] $OnlyNetFXSDK,
1717
[Parameter()] [switch] $OnlyDIASDK,
18-
[Parameter()] [switch] $OnlyAndroid
18+
[Parameter()] [switch] $OnlyAndroid,
19+
[Parameter()] [string] $UnrealRoot # Provide an UnrealRoot to determine what SDK versions are supported by it's provided AutoSDK section
1920
)
2021

2122
. ".\Get-AutoSDK-PlatformPath.ps1"
@@ -56,6 +57,46 @@ if ($OnlyAndroid) {
5657
$SkipDIASDK = $true
5758
}
5859

60+
if ($UnrealRoot) {
61+
$UnrealAutoSDKBasePath = [IO.Path]::Combine($UnrealRoot, "Engine", "Extras", "AutoSDK")
62+
if (-not (Test-Path -Path $UnrealAutoSDKBasePath)) {
63+
Write-Error "UnrealRoot provided, but AutoSDK path not found: $UnrealAutoSDKBasePath"
64+
Exit -1
65+
}
66+
Write-Output "Using Unreal Root Path to determine AutoSDK path: $UnrealAutoSDKBasePath"
67+
# Get list of directories in the UnrealAutoSDKBasePath, that is the list of hosts supported.
68+
$Hosts = Get-ChildItem -Path $UnrealAutoSDKBasePath | Where-Object { $_.PSIsContainer } | Select-Object -ExpandProperty Name
69+
Write-Output "Hosts: $($Hosts -join ', ')"
70+
$SupportedSDKs = @()
71+
# Enumerate the Hosts directories, to get the lists of targets supported.
72+
$Hosts | ForEach-Object {
73+
$HostPath = [IO.Path]::Combine($UnrealAutoSDKBasePath, $_)
74+
$Targets = Get-ChildItem -Path $HostPath | Where-Object { $_.PSIsContainer } | Select-Object -ExpandProperty Name
75+
# Enumerate the HostPath directories, to get the SDK Versions supported.
76+
$BuildHost = $_
77+
$Targets | ForEach-Object {
78+
$TargetPath = [IO.Path]::Combine($HostPath, $_)
79+
$SDKVersions = Get-ChildItem -Path $TargetPath | Where-Object { $_.PSIsContainer } | Select-Object -ExpandProperty Name
80+
# if hostpath is HostWin64 and target is anything other than LLVM, then skip
81+
if ($BuildHost -eq "HostWin64" -and $_ -eq "Win64") {
82+
# ignore DIASDK, VS, Windows Kits, as Unreal autodetects their presence and there are no useful scripts included in their AutoSDK
83+
$SDKVersions = $SDKVersions | Where-Object { @("DIA SDK", "VS2017", "VS2019", "VS2022", "Windows Kits") -notcontains $_ }
84+
}
85+
86+
$SupportedSDKs += @{
87+
Host = $BuildHost
88+
Target = $_
89+
Versions = $SDKVersions
90+
}
91+
}
92+
}
93+
# Write a list of supported SDKs in a tabular format
94+
Write-Output "Supported SDKs for UnrealRoot: $UnrealRoot"
95+
$SupportedSDKs | ForEach-Object {
96+
Write-Output "Host: $($_.Host) Target: $($_.Target) SDK Versions: $($_.Versions -join ', ')"
97+
}
98+
}
99+
59100
$AutoSDKRoot = Get-Item -Path $Path -ErrorAction SilentlyContinue
60101
if (-not $AutoSDKRoot) {
61102
Write-Output "AutoSDK path not found: $Path"

0 commit comments

Comments
 (0)