-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mingw cross compiler support. #99
base: Godot-3.x
Are you sure you want to change the base?
Conversation
windows from linux.
Hey I've been meaning for some time to implement this myself, so thanks for working on this! A couple of comments:
:) |
@beniwtv I don't think @zombieCraig is changing that behavior, whats new here is that you can perform the windows platform build on a non windows platform and therefor require to find out the host platform. Godot I believe does the same for its cross compiling. I've never experimented with it myself I need to take a closer look but if my understanding is correct I'm happy to merge this in. My only preliminary remark is whether it makes sense to check the host platform so early as its now also checked when you're compiling a linux build on linux, not that it would do any harm. |
Oh yes, Sorry I didn't respond earlier. I saw the message then got
distracted and forgot to reply. The behavior should be the exact same. I
just add an extra check for mingw and I did it the same way godot core does
it. That's actually the reason there is some extra code. It was just to
make it work in almost the exact same way with the same variable names.
I'm not very familiar with SCons so let me know if I should redo this.
…On Thu, Jul 23, 2020 at 9:45 PM Bastiaan Olij ***@***.***> wrote:
@beniwtv <https://github.com/beniwtv> I don't think @zombieCraig
<https://github.com/zombieCraig> is changing that behavior, whats new
here is that you can perform the windows platform build on a non windows
platform and therefor require to find out the host platform.
Godot I believe does the same for its cross compiling. I've never
experimented with it myself
I need to take a closer look but if my understanding is correct I'm happy
to merge this in. My only preliminary remark is whether it makes sense to
check the host platform so early as its now also checked when you're
compiling a linux build on linux, not that it would do any harm.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#99 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAELD5PRWRB2TQM5R4252CDR5EGYDANCNFSM4OOKP7XA>
.
|
I'd like to put in a vote for this too! I actually independently made an almost identical change, available here: I think it's a good approach. Tested my variant on Linux (both native linux and mingw64) and on windows (msvc 2017) |
Ah yes I must have mistaken that variable, sorry, I got mixed up and thought platform was being overwritten :) |
Hi managed to test this successfully with two small issues:
:) |
Oh no! 🤦 I can't tell you how many times python has bitten me for things like that. My IDE is VI, and I only usually code python patch others code. Needless to say, whitespace programming languages and myself do not get along. I'll fix that and resubmit. |
Note: I'm going to see if the proposed fix works, running this script on openvr.h to generate a compatible version: https://gist.github.com/tunabrain/1fc7a4964914d61b5ae751d0c84f2382 I'll let you know if I am able to make headway on this crash, but basically OpenVR is designed using a C++ ABI and it's a bit scary to link code made with two different compilers Just a heads-up so you don't spend lots of time debugging crashes. Also, to workaround the .so problem, add this into the if statement:
I have a complete diff if you want it, which includes |
Thanks for the heads up on the crash! We did link LLVM with GCC compiled things when GCC was causing a crash before, and there weren't any issues, but I guess you never know! |
@beniwtv Got it working!! I have pushed my version of wrap_mingw.py here: You can see my commits here: https://github.com/lyuma/godot_openvr/tree/mingw (Note, requires a patch to replace Here are the commands I am running from my CI system:
|
Good news, Benedikt has updated wrap_openvr.py to have a MIT license: would a PR for this be helpful? I'd be curious if anyone else has run into the issues I had when using a HMD with mingw-compiled libgodot_openvr.dll (the crash only happens when actually running in VR) |
We'd need to run this file either manually or via scons during (before) cross-compile right? The Python script creates a wrapper, that uses OpenVR's C code instead of the C++ one, so we are using the C ABI which is more compatible, as I understand it. @BastiaanOlij Do you think this would be an acceptable approach for us? |
If we can script it so it only does that when the mingw build is run, I don't have anything against that solution. It's no different than the extra step done on MacOS |
This needs a rebase |
Since we now have automated builds for every platform, is this still something we want to pursue? |
I haven't tried the new system but if I can build on Linux then we don't
need this.
…On Mon, Nov 16, 2020 at 9:46 AM Benedikt ***@***.***> wrote:
Since we now have automated builds for every platform, is this still
something we want to pursue?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#99 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAELD5MFIEWFXO7Y3LGARYDSQFQQ3ANCNFSM4OOKP7XA>
.
|
@beniwtv Apologies for being a bit out-of-the-loop on this, but what exactly is the new automated builds approach? If this is a reference to GitHub Actions, unfortunately that is not an acceptable approach for us. GitHub Actions is proprietary (even if free-as-in-beer), and requirements for my project are that we be able to use our own hardware to compile releases... Running Visual Studio emulated with Wine might be possible, but it sounds like a maintenance nightmare. @zombieCraig mentions Linux. If there is a fix for Linux based (non-MS VIsual Studio) compilers such as mingw GCC, llvm-mingw, would it be possible to point me in that direction? |
@lyuma Yes, the automatic builds won't then fulfill those requirements then -> so we still need this. Feel free to rebase & resend :) |
Added host detection in SConstruct and set the flags for mingw++ compiling for linux and osx for compiling windows.