Unreal Engine Slim Source Build
To build Unreal Engine from source with only Windows platform selected, you need to call Setup.bat with this arguments :
./Setup.bat -exclude=Mac -exclude=osx64 -exclude=osx32 -exclude=iOS -exclude=Linux32 -exclude=HoloLens -exclude=TVOS -exclude=Win32 -exclude=WinRT -exclude=HTML5 -exclude=XboxOne -exclude=Switch -exclude=Dingo -exclude=PS4 -exclude=LeapMotion
After you run this Setup.bat and GenerateProjectFiles.bat , edit the file \Engine\Intermediate\ProjectFiles\AutomationTool.csproj.References and manually remove references to unwanted platforms, for UE5 it should look like this :
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="16.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ProjectReference Include="AutomationUtils\AutomationUtils.Automation.csproj" />
<ProjectReference Include="BuildGraph\BuildGraph.Automation.csproj" />
<ProjectReference Include="CookedEditor\CookedEditor.Automation.csproj" />
<ProjectReference Include="CrowdinLocalization\CrowdinLocalization.Automation.csproj" />
<ProjectReference Include="Gauntlet\Gauntlet.Automation.csproj" />
<ProjectReference Include="Localization\Localization.Automation.csproj" />
<ProjectReference Include="LowLevelTests\LowLevelTests.Automation.csproj" />
<ProjectReference Include="OneSkyLocalization\OneSkyLocalization.Automation.csproj" />
<ProjectReference Include="Scripts\AutomationScripts.Automation.csproj" />
<ProjectReference Include="Turnkey\Turnkey.Automation.csproj" />
<ProjectReference Include="Win\Win.Automation.csproj" />
<ProjectReference Include="XLocLocalization\XLocLocalization.Automation.csproj" />
</ItemGroup>
</Project>
Open UE5.sln .
Right-click Solution>Engine>UE5 and select Set as Startup Project .
Right-click Solution>Programs>UnrealBuildTool and Build .
Open Solution\Programs\Automation\CookedEditor.Automation\PlatformWrappers.cs ( path = \Engine\Source\Programs\AutomationTool\CookedEditor\PlatformWrappers.cs ) and delete all unwanted platforms.
Right-click Solution>Programs>AutomationTool and Build .
Right-click Solution and Build Solution .