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

Compiling for Different OSes #1738

Closed
ahmutkadim opened this issue Dec 31, 2023 · 8 comments
Closed

Compiling for Different OSes #1738

ahmutkadim opened this issue Dec 31, 2023 · 8 comments

Comments

@ahmutkadim
Copy link

I know it is stated in readme that it is intended to be compiled for the same OS but it is not intuitive. Is there an alternative method that I can use to distribute apps in different Desktop OSes from the same OS. I use MacOS.

@joshtynjala
Copy link
Member

The only option to compile for other operating systems from macOS would be to run virtual machines with those other operating systems. So you’d be compiling in the other OS, but you’d need only the one computer.

A requirement to compile for a specific OS from the same OS is very common for cross platform toolkits. So it’s not a unique limitation of Lime/OpenFL.

@ahmutkadim
Copy link
Author

I do not have enough hardware resources to allocate to a virtual machine. And I think it kinda is since many game creation tools provide support to build for different operating systems via export templates. Is there a similar alternative?

@joshtynjala
Copy link
Member

If you want to build a Windows app, you must do it on Windows. If you want to build a macOS app, you must do it on macOS. If you want to build a Linux app, you must do it in Linux. Android and iOS are special cases that can be build from another operating system (Android from Windows/macOS/Linux, but iOS from macOS only), but that's basically the only option for targeting a different operating system.

I'm sorry, but the README is correct. You either need VMs or multiple computers.

@joshtynjala joshtynjala changed the title Compiling for Different Ones Compiling for Different OSes Dec 31, 2023
@player-03
Copy link
Contributor

I mean, people have attempted to add cross-compilation support to Lime (see #1661), and GCC can be configured to do it, so it isn't like it's impossible. Just maybe not something that we've successfully done here with Lime.

For an easier alternative, it ought to be possible to compile for HL, and then use premade wrappers or scripts to run that bytecode on whatever machine you like. See #1610 for more on that.

@DigiEggz
Copy link

Using changes made by @tobil4sk, I've been able to compile a native c++ Windows app from macOS. A few PRs were recently merged within hxcpp to make this possible (HaxeFoundation/hxcpp#1045 and HaxeFoundation/hxcpp#1046) and now I think the only one left to approve is #1661.

@ahmutkadim
Copy link
Author

So, now can I compile for windows on MacOS?

@DigiEggz
Copy link

DigiEggz commented Jan 12, 2024

So, now can I compile for windows on MacOS?

If you implement those changes, yes. This also helps if you're confused about how to set up your MinGW environment: https://gist.github.com/darmie/99fbd3512b49d0b8cc11fb93bf2b3f8c

@DigiEggz
Copy link

DigiEggz commented Jan 12, 2024

Additionally, another user has recently posted a guide on how to compile to Linux from macOS: https://community.haxe.org/t/hxcpp-cross-compilation-macos-to-linux/4104

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants