linuxg++haxeopenflhaxelib

How to cross compile Haxe/OpenFL generated source code using minGW?


I have got a CPP source files generated by OpenFL/Haxe for Linux (Fedora 21 x86_64).

I would like to attempt to cross-compile this to Windows executable using mingw-64 but does not know how to generate the proper Makefile for this as there where alot of cpp files in the scr folder.

How do I create this make file?

or

If there is an approach to configure OpenFL/Haxe to do cross compile using mingw-64 that would also be appreciated.


Solution

  • Compiling Windows program from linux was not available from OpenFl during that time, I created several pull requests and code updates to enable it, however, the attempt was turned down. I think its due to manageability and market. But idea of coding in Linux for every OS makes Linux a powerful coding platform!

    It took quite sometime to solve it on my end since some codes in its haxe component was needed to be updated. I continued my research and ended up contributing few codes to OpenFl and Haxe/Hxcpp.

    New problems in compilation have arised that are far more difficult to solve, Ret-Mode have proposed a better solution that time. For those interested, check here: https://github.com/Ret-Mode/lime apply his fix to your Lime installation. The method for cross-compilation is as follows:

    Installation on Linux for crosscompilation

    1 Clone repository

    git clone --recursive https://github.com/Ret-Mode/lime
    

    2 Setup:

    haxelib dev lime lime
    

    2a Rebuild tools (from lime/${version}/tools folder):

    haxe tools.hxml
    

    3 First build for Your linux architecture:

    haxelib run lime rebuild linux -DHXCPP_M32 -32
    haxelib run lime rebuild linux -DHXCPP_M64 -64
    

    3a Build lime for MinGW, also choose Your MinGW arch:

    haxelib run lime rebuild windows -Dmingw -DHXCPP_M32 -32
    haxelib run lime rebuild windows -Dmingw -DHXCPP_M64 -64
    

    4 Build projects for Your arch:

    haxelib run lime build windows -Dmingw -64
    haxelib run lime build windows -Dmingw -32
    

    5 If You have WINE installed, You should have Your app icon swapped. If not, app will have native icon, but will work