|
15 | 15 | [Parameter()] [switch] $OnlyWindowsSDK,
|
16 | 16 | [Parameter()] [switch] $OnlyNetFXSDK,
|
17 | 17 | [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 |
19 | 20 | )
|
20 | 21 |
|
21 | 22 | . ".\Get-AutoSDK-PlatformPath.ps1"
|
@@ -56,6 +57,46 @@ if ($OnlyAndroid) {
|
56 | 57 | $SkipDIASDK = $true
|
57 | 58 | }
|
58 | 59 |
|
| 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 | + |
59 | 100 | $AutoSDKRoot = Get-Item -Path $Path -ErrorAction SilentlyContinue
|
60 | 101 | if (-not $AutoSDKRoot) {
|
61 | 102 | Write-Output "AutoSDK path not found: $Path"
|
|
0 commit comments