Did they make it in by any chance? I’m wondering if this is something I can try out right now.
Whoops, i just noticed your post, @CoolOppo. I have not actually tried it out, but my changes were merged into 4.22, so unless something else broke, it should work, for the caveats I originally gave, unless they fixed those too. 4.22 also contained Clang 7 support for Linux, coincidentally.
I vaguely recall a suggestion that Epic might start including Clang for Windows in their autobuild stack. Not sure where I read or heard that though, and it was probably aspirational anyway.
Get compile_commands.json - Platform & Builds - Epic Developer Community Forums updated. This has been added in UE 4.24, as a feature of UBT. (So there goes that holiday project…)
Hey Paul does Unreal editor still compile with Clang for Windows?
Are there any docs on this anywhere? I found this: Cross-Compiling for Linux | Unreal Engine Documentation but thats for Linux only?
Would appreciate if you could help over a Discord chat or similar platform if possible (if UE still even compiles with Clang for Windows that is) in case I run into any issues while compiling.
I dont really have any reason for compiling with Clang other than that I just know Clang usually make better binaries, error msgs (etc) (And that I for that reason never really familiarised myself very well with the MVSC default headers and such for those reasons). Im just building for myself for use on Windows
If I was to decide I would have gone 100% Clang
Its a little strange tho that they only support a limited amount of IDEs tho. Should be easy to setup with any IDE of choice imho
Oh, I thought you referred to the IDE there (tho still I think every dev should be able to choose by themselves what IDE to use).
But so if I understood the situation right, for building the editor for Windows Im stuck with MVSC, but building custom C++ classes should work fine with Clang if you setup your BuildConfiguration.xml accordingly?
Can I use Clang with Live Coding? Changing my BuildConfiguration.xml to:
<?xml version="1.0" encoding="utf-8"?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
<WindowsPlatform>
<Compiler>Clang</Compiler>
</WindowsPlatform>
</Configuration>
<?xml version="1.0" encoding="utf-8"?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
<WindowsPlatform>
<Compiler>Clang</Compiler>
</WindowsPlatform>
</Configuration>
It keeps recompiling my entire project every time I press compile instead of the ones I touched recently.
Is this yet not supported or are there some other flags I can use to get it not to compile everything?
Apologies in advance for bumping an old thread, but because this is the first one that comes up in search engines regarding the topic, I figured sharing the latest with respect to compiling UE4 with Clang on Windows.
- Install the clang compiler for Windows (I’ve successfully tested this with Clang-11.0.0)
- Run the following in the command line window:
git clone https://github.com/EpicGames/UnrealEngine
cd UnrealEngine
rem "release" was on UE v4.27.0 at the time of writing this post
git checkout release
Setup.bat
GenerateProjectFiles.bat -Verbose -Compiler=Clang
The “verbose” argument is optional. With it enabled you should notice the following output:
Compiler: C:\Program Files\LLVM\bin\clang-cl.exe
Linker: C:\Program Files\LLVM\bin\lld-link.exe
Library Manager: C:\Program Files (x86)\Microsoft Vis...\bin\HostX64\x64\lib.exe
Resource Compiler: C:\Program Files (x86)\Windows Kits\10\bin...\x64\rc.exe
- Open UE4.sln in MSVC and only build the /Engine/UE4 project (not the entire solution)
That’s all there is to it!
@officernickwilde thank you for the update!
Do I understand correctly that you are using Clang version built with MSVC toolchain and using MSVC runtime?
I’m in the middle of figuring out if it’s possible to build UE using MinGW64 + Clang targeting x64-windows-gnu triple. My main goal is to build UE without requirements for the MSVC licensing.
What I’m stuck right now is symbol duplication error when linking with lld for things like “Initialize Method” function. I wonder if def files are used for this particular case… Would really appreciate if someone could shine a light on it
All in all, latest build of lld looks really promising, it has functionpadmin flag required by Live++, generated pdb files are accepted by VS and Rider for Unreal Engine.
this is amazing!
i really hope this is still active.
it would be great if this could facilitate cross compiling from linux to windows.