Is it possible to cross-compile all other binary for all other platforms from macOS?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By haxpor
:warning: Old Version Published before Godot 3 was released.

The scenario is that at some points I might be creating a c++ custom module. So I have to re-compile godot for all platform (included templates). As I don’t have Windows box with me, I would like to ask whether it’s possible to do cross-compile from macOS alone for all other platforms?

As my understanding, in 3.0 the whole process will be much simpler as there’s no need to re-compile as seen in this blog. Anyway, I want to explore this engine and see what options I have for 2.1 first. Thanks!

For modules you need to compile engine and templates on 2 and 3 too, I have no idea how is to compile from Mac OSX to windows but I assume is not too different than from a Linux system (just depends on mingw).

If your module have some extra dependences, that may complicate things a bit, you should look if these dependences can be cross compiled (some may not work with mingw).


The gdnative libraries will depend on what the libraries use and may be hard to cross compile in some cases (windows support can be poor for some things).

ps: Leaving this as comment because I have no experience with your OS.

eons | 2017-12-17 15:15

Thanks for your input eons!

That allows me to understand better about compiling stuff. And you’re right about mingw. It seems on Windows and Linux will have better time and support to do cross-compile compared to from macOS one. But I just saw this that you can do cross-compile with tools available from macOS as well.

I think that’s all I need now.

haxpor | 2017-12-18 01:43

:bust_in_silhouette: Reply From: haxpor

Thanks for eons’s input in the comment above mentioning about mingw, and approach in general.

I as well came upon this official document about cross-compiling for Windows from macOS. So it’s possible to do so.