Skip to content
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

[Feature/Docs] Ability to Cross Compile From Linux to Windows & Mac #48

Open
zicklag opened this issue Aug 1, 2020 · 3 comments
Open
Labels
help wanted Extra attention is needed

Comments

@zicklag
Copy link

zicklag commented Aug 1, 2020

Is your feature request related to a problem? Please describe.
I prefer to build applications in Linux Docker containers for maximum automation, reproducibility, and build portability. That said, I still need to be able to build applications for Windows and Mac and I have since done that by cross compiling the application using MingW for windows and OSX Cross for Mac. Without being able to cross compile from Linux, you have to use a CI service that provides all three operating systems. While these exist, and they are free for Open Source projects, I prefer to be able to host these builds myself when necessary and the most cost effective and simple way to do that is by cross compiling from Linux.

Describe the solution you'd like
I would like to work out the required build steps and tools necessary to cross-compile for Windows and Mac from Linux.

Describe alternatives you've considered
Going with GitHub Actions for automated builds is definitely a decent option, but again, I prefer to be able to produce these same builds on my local machine and using Linux Docker containers is the most productive way to do that.

Additional context
If we get this working I am going to be building my Tauri application with Drone and could easily derive a template build that could be used for other's Tauri applications, allowing people to build for all three platforms using only Linux servers on either the public Drone cloud, or their own build farm.

@zicklag zicklag changed the title Ability to Cross Compile From Linux to Windows & Mac [Feature/Docs] Ability to Cross Compile From Linux to Windows & Mac Aug 1, 2020
@wusyong wusyong added the help wanted Extra attention is needed label Aug 6, 2020
@wusyong
Copy link
Contributor

wusyong commented Aug 6, 2020

This is going to be to complicated process I think. Especially it's a nightmare to be able to run on windows image because of dll paths.

@zicklag
Copy link
Author

zicklag commented Aug 6, 2020

I still haven't succeeded in it yet, but I think it may not be impossible to get working using mingw and a pre-built webview.dll which is going to be built automatically on a windows machine in Webview's CI ( webview/webview#440 ).

I haven't had time to test it out yet, but we should be able to compile with MingW and link against that webview.dll and include the webview.h to compile against it.

Some reference: webview/webview#311.

@zicklag
Copy link
Author

zicklag commented Aug 7, 2020

Well, maybe it won't work. I don't know why, but when I compile a simple C program just like is mentioned here and I link against the pre-built DLL, the generated executable will not run ( in my windows dev VM ). I gets to showing the window, which actually does get the titlebar title set correctly, but the window just goes into "Not responding" mode with a white screen as soon as it pops up. 😕

I tried compiling with Clang and MingW. I'm not sure if it has something to do with trying to link a gnu abi executable to an msvc abi library? I've never done that before I don't think. I don't know.

I guess I might just have to do the compilation on windows with GitHub actions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants