How to Specify Unreal Engine Source/Project Compiler Toolchain and SDK

Contrary to common sense, UnrealBuildTool does not use EPIC’s tested toolchain and SDK versions that the “Build farm compiles against” and instead uses “WindowsPlatform.DefaultToolChainVersion” and “WindowsPlatform.DefaultWindowsSdkVersion” by default. This may not be a good idea and may cause problems down the line.

Retargeting solution via Visual Studio does not change the SDK used.

To specify a specific toolchain(compiler) and SDK, you need to change two elements in BuildConfiguration.xml, located

Windows:

  • Engine/Saved/UnrealBuildTool/BuildConfiguration.xml
  • <USER>/AppData/Roaming/Unreal Engine/UnrealBuildTool/BuildConfiguration.xml
  • My Documents/Unreal Engine/UnrealBuildTool/BuildConfiguration.xml
  • <PROJECT_DIRECTORY>/Saved/UnrealBuildTool/BuildConfiguration.xml

On Linux and Mac, the following paths are used instead:

  • /Users/<USER>/.config//Unreal Engine/UnrealBuildTool/BuildConfiguration.xml
  • /Users/<USER>/Unreal Engine/UnrealBuildTool/BuildConfiguration.xml
  • <PROJECT_DIRECTORY>/Saved/UnrealBuildTool/BuildConfiguration.xml

Use the <PROJECT_DIRECTORY>/Saved/UnrealBuildTool/BuildConfiguration.xml directory for project-specific build configuration where <PROJECT_DIRECTORY> is the path to your project’s directory.

Edit the XML file to something that looks like this:

<?xml version="1.0" encoding="utf-8" ?>

<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">

<WindowsPlatform>
<CompilerVersion>14.38.33130</CompilerVersion>
<WindowsSdkVersion>10.0.18362.0</WindowsSdkVersion>
<!-- Replace version numbers with the ones you want -->
</WindowsPlatform>
</Configuration>

If you are not using an MSVC compiler, you need to specify ToolchainVersion too.
Links:
Tested Toolchain & SDK for UE 5.4
Build Configuration Info

1 Like

You can specify Compiler, CompilerVersion, ToolchainVersion, WindowsSdkVersion etc. in config file of engine category.

for example:

In the <PROJECT_DIRECTORY>/config/DefaultEngine.ini

[/Script/WindowsTargetPlatform.WindowsTargetSettings]
Compiler=Default
CompilerVersion="Latest"
ToolchainVersion="Latest"
WindowsSdkVersion = "Latest"

just replate “Latest” with any of your preferred version like

CompilerVersion="14.13.26128"

2 Likes

Thank you very much @rohitsutreja this was exactly what I needed!

I package a plugin for multiple versions of UE (from 4.27 to 5.5) and setting the toolchain version in the BuildConfiguration.xml was causing issues:

  • The ones located in the AppData and in the user’s Documents are shared by all engine versions.
  • I tried to add one in the Engine/Saved/UnrealBuildTool but it doesn’t seem to work (maybe this one is used only when building the engine from source?)
  • I package the plugin from command line, which creates a temporary project to compile it. So it was not an option to set it per-project.

However, using the .ini files allow me set a custom toolchain version per engine (not per project).
To do that I’ve just modified the file <ENGINE_DIR>/Engine/Config/BaseEngine.ini with the compiler version and the toolchain version.
For example, for UE 5.3 I’ve modified C:/Program Files/Epic Games/UE_5.3/Engine/Config/BaseEngine.ini by adding those 2 lines in the WindowsTargetSettings group (by searching Windows in the file):

CompilerVersion="14.38.33130"
ToolchainVersion="14.38.33130"

So at the end it looks like that in the BaseEngine.ini file:

...

[/Script/WindowsTargetPlatform.WindowsTargetSettings]
+D3D12TargetedShaderFormats=PCD3D_SM5
+D3D11TargetedShaderFormats=PCD3D_SM5
bEnableDistanceFields=true
bEnableRayTracing=true
bTarget32Bit=false
CompilerVersion="14.38.33130"
ToolchainVersion="14.38.33130"

...
1 Like