Cross compiling for Windows on Linux and OS X

Foreword: I don’t actually have Unreal Engine installed yet; my team and I are new to Unreal and are just seeing how things will go before trying it out.

Nowword: Because not all of our team uses Windows, I was wondering how to go about cross compiling an Unreal game project on Linux and OS X systems (at least one of us prefers to build using makefiles, too, for some reason) I had found a question or two similar to this one, but I haven’t really found a good answer (or I am [figuratively] blind). I only know that I will probably need some Windows libraries (can’t build for a target without the libraries of the target, right? o3o), but I don’t know which. Clang is our preferred compiler (except the Windows guys, who use Visual Studio).

So uh, how do we go about this?

1 Like

Hi,

Unfortunately whilst it is theoretically possible to cross compile for windows using mingw there are going to be many issues for it to work reliably to package a game in UE4. One issue would be the path mingw would take during compiliation would be completely untested and different from the Windows on Windows builds. The second major issue is that during packaging for Windows the shaders for example need to be pre-compiled for DirectX and other Windows only tools need to be run.

Microsoft has been releasing some tools as open source such as a new shader compiler built on clang/llvm, so there is hope for the future. However if you are feeling adventurous there are two main ways you could compile and package for windows from the Linux editor:

  1. Download the Visual Studio Command Line tools and SDK using wine and then append wine to the invocation of UBT.
  2. Run Windows inside a VM or second machine and remotely compile.

I am unsure if the remote build support to Windows is enabled in UE4 on Linux but this is the method I would currently suggest to be the most stable and produce the most reliable builds.

Hey,
so it is mostly a year ago and the problem ist still there.
I´m interesting in building a CI/CD pipeline to fully automatically build and cook a game on a central linux server.
After trying and searching around i found your post and be disappointed!
If you find any idea or something that could help me build the pipeline so please let me know!
I will appreciate it a lot.

Best regards,
Darkentik