Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/build_self_hosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ jobs:
call Build.bat --git-code T8w6TYB_r71gGTP3A02B
shell: cmd

- name: install
run: |
call RunUAT.bat
shell: cmd

- uses: mickem/clean-after-action@v1

- name: Delete .git folder
Expand Down
8 changes: 4 additions & 4 deletions Engine/Build/InstalledEngineBuild.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
<!-- Generate full debug info for binary editor and packaged application builds -->
<Option Name="WithFullDebugInfo" Restrict="true|false" DefaultValue="false" Description="Generate full debug info for binary editor and packaged application builds"/>

<!-- Whether to use VS2019 -->
<Option Name="VS2019" Restrict="true|false" DefaultValue="false" Description="Use Visual Studio 2019 to build Windows targets. By default, Visual Studio 2017 is used for maximum compatibility"/>
<!-- Whether to use VS2022 -->
<Option Name="VS2022" Restrict="true|false" DefaultValue="false" Description="Use Visual Studio 2022 to build Windows targets. By default, Visual Studio 2022 is used for maximum compatibility"/>

<!-- The local output directory -->
<Property Name="LocalInstalledDir" Value="$(RootDir)/LocalBuilds/Engine/Windows"/>
Expand Down Expand Up @@ -107,8 +107,8 @@
<Property Name="TargetDebugInfoArg" Value="" If="$(WithFullDebugInfo)"/>

<!-- Compile flags for Windows targets -->
<Property Name="VSCompilerArg" Value="-2017"/>
<Property Name="VSCompilerArg" Value="-2019" If="$(VS2019)"/>
<Property Name="VSCompilerArg" Value="-2019"/>
<Property Name="VSCompilerArg" Value="-2022" If="$(VS2022)"/>

<!-- Names of the client and server targets to build -->
<Property Name="OptionalClientTarget" Value=""/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ public override void ExecuteBuild()
// Option for verifying that all include directive s
bool bStrictIncludes = ParseParam("StrictIncludes");

// Whether to use VS2019 for compiling all targets. By default, we currently use 2017 for compiling static libraries for maximum compatibility.
bool bVS2019 = ParseParam("VS2019");

// Whether to use VS2022 for compiling all targets. By default, we currently use 2019 for compiling static libraries for maximum compatibility.
bool bVS2022 = ParseParam("VS2022");

// Make sure the packaging directory is valid
DirectoryReference PackageDir = new DirectoryReference(PackageParam);
Expand Down Expand Up @@ -108,7 +109,7 @@ public override void ExecuteBuild()
// Compile the plugin for all the target platforms
List<UnrealTargetPlatform> HostPlatforms = ParseParam("NoHostPlatform")? new List<UnrealTargetPlatform>() : new List<UnrealTargetPlatform> { BuildHostPlatform.Current.Platform };
List<UnrealTargetPlatform> TargetPlatforms = GetTargetPlatforms(this, BuildHostPlatform.Current.Platform);
FileReference[] BuildProducts = CompilePlugin(HostProjectFile, HostProjectPluginFile, Plugin, HostPlatforms, TargetPlatforms, AdditionalArgs.ToString(), bVS2019);
FileReference[] BuildProducts = CompilePlugin(HostProjectFile, HostProjectPluginFile, Plugin, HostPlatforms, TargetPlatforms, AdditionalArgs.ToString(), bVS2022);

// Package up the final plugin data
PackagePlugin(HostProjectPluginFile, BuildProducts, PackageDir, ParseParam("unversioned"));
Expand Down Expand Up @@ -137,7 +138,7 @@ FileReference CreateHostProject(FileReference HostProjectFile, FileReference Plu
return FileReference.Combine(HostProjectPluginDir, PluginFile.GetFileName());
}

FileReference[] CompilePlugin(FileReference HostProjectFile, FileReference HostProjectPluginFile, PluginDescriptor Plugin, List<UnrealTargetPlatform> HostPlatforms, List<UnrealTargetPlatform> TargetPlatforms, string AdditionalArgs, bool bVS2019)
FileReference[] CompilePlugin(FileReference HostProjectFile, FileReference HostProjectPluginFile, PluginDescriptor Plugin, List<UnrealTargetPlatform> HostPlatforms, List<UnrealTargetPlatform> TargetPlatforms, string AdditionalArgs, bool bVS2022)
{
List<FileReference> ManifestFileNames = new List<FileReference>();

Expand All @@ -163,7 +164,7 @@ FileReference[] CompilePlugin(FileReference HostProjectFile, FileReference HostP
{
if(Plugin.SupportsTargetPlatform(TargetPlatform))
{
string AdditionalTargetArgs = AdditionalArgs + (bVS2019 ? "" : " -2017");
string AdditionalTargetArgs = AdditionalArgs + (bVS2022 ? "" : " -2019");
CompilePluginWithUBT(HostProjectFile, HostProjectPluginFile, Plugin, "UE4Game", TargetType.Game, TargetPlatform, UnrealTargetConfiguration.Development, ManifestFileNames, AdditionalTargetArgs);
CompilePluginWithUBT(HostProjectFile, HostProjectPluginFile, Plugin, "UE4Game", TargetType.Game, TargetPlatform, UnrealTargetConfiguration.Shipping, ManifestFileNames, AdditionalTargetArgs);
}
Expand Down
32 changes: 32 additions & 0 deletions RunUAT.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
@echo off

set "Root=%~dp0"
set "RunUAT=%Root%Engine\Build\BatchFiles\RunUAT.bat"
set "BuildGraphScript=%Root%Engine\Build\InstalledEngineBuild.xml"

if not exist "%RunUAT%" (
echo Could not find "%RunUAT%".
pause
exit /b 1
)

if not exist "%BuildGraphScript%" (
echo Could not find "%BuildGraphScript%".
pause
exit /b 1
)

rem fix: Unable to find installation of PDBCOPY.EXE
.git\ue4-gitdeps\X64_Debuggers_And_Tools-x64_en-us.msi

if exist "%ProgramW6432%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" (
echo Using Visual Studio 2022 for packaging.
call "%RunUAT%" BuildGraph -script="%BuildGraphScript%" -target="Make Installed Build Win64" -nosign -set:GameConfigurations=Development;Shipping -set:WithWin64=true -set:WithWin32=false -set:WithMac=false -set:WithAndroid=false -set:WithIOS=false -set:WithTVOS=false -set:WithLinux=false -set:WithLinuxAArch64=false -set:WithDDC=false -set:VS2022=true -clean
) else (
echo Using Visual Studio 2019 for packaging.
call "%RunUAT%" BuildGraph -script="%BuildGraphScript%" -target="Make Installed Build Win64" -nosign -set:GameConfigurations=Development;Shipping -set:WithWin64=true -set:WithWin32=false -set:WithMac=false -set:WithAndroid=false -set:WithIOS=false -set:WithTVOS=false -set:WithLinux=false -set:WithLinuxAArch64=false -set:WithDDC=false -clean
)


pause
exit /b %ERRORLEVEL%
Loading