How to use Clang on Windows ?

You are welcome, I am glad you found my post helpful.

Unfortunately, I did not build UE from source, I download the binary build from Epic Games Launcher and use Clang to build my C++ source code, not the engine.

For every UE version you would like to use, you should check the release notes of that version and scroll down to Platform SDK Upgrades section and check what Epic Games recommend for each version. (Ctrl+F in browser, type “farm” to get there quickly)

In your case for Unreal Engine 5.3:

  • Visual Studio 2022 v17.4 or newer
  • Windows SDK 10.0.18362 or newer
  • LLVM clang 14.0.1
  • .NET 4.6.2 Targeting Pack
  • .NET 6.0

IDE Version the Build farm compiles against

  • Visual Studio: Visual Studio 2022 17.4 14.34.31933 toolchain and Windows 10 SDK (10.0.18362.0)

Some people reported that setting <CompilerVersion> in BuildConfiguration.xml to Latest instead of manually typing your version e.g. 14.0.1; is necessary or it might have problems or something I can’t remember (experiment to check it out, I don’t have links or source to prove that). So having 1 LLVM installation might be the way to go. Also make sure it is installed in C:\Program Files\LLVM and it is added to PATH, I guess UE expects LLVM to be at its default directory.

Finally, from my last post, the BuildConfiguration.xml shown was the configuration I had set to build with Clang before I left back for MSVC.

<?xml version="1.0" encoding="utf-8" ?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
    <WindowsPlatform>
        <Compiler>Clang</Compiler>
        <CompilerVersion>Latest</CompilerVersion>
        <Toolchain>VisualStudio2022</Toolchain>
        <ToolchainVersion>14.34.31933</ToolchainVersion>
    </WindowsPlatform>
    <ProjectFileGenerator>
        <Format>VisualStudioCode</Format>
    </ProjectFileGenerator>
</Configuration>

Good luck!

1 Like