www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Compile for other OS's on Windows?

reply "Bauss" <jj_1337 live.dk> writes:
Is it possible to compile for other OS's on Windows using dmd?
Jan 05 2015
parent reply "Gary Willoughby" <dev nomad.so> writes:
On Monday, 5 January 2015 at 11:49:32 UTC, Bauss wrote:
 Is it possible to compile for other OS's on Windows using dmd?
This is what's known as cross compiling and is not currently supported by DMD at this time.
Jan 05 2015
parent reply "Bauss" <jj_1337 live.dk> writes:
On Monday, 5 January 2015 at 12:54:00 UTC, Gary Willoughby wrote:
 On Monday, 5 January 2015 at 11:49:32 UTC, Bauss wrote:
 Is it possible to compile for other OS's on Windows using dmd?
This is what's known as cross compiling and is not currently supported by DMD at this time.
Any alternatives?
Jan 05 2015
next sibling parent "Colin" <grogan.colin gmail.com> writes:
On Monday, 5 January 2015 at 15:00:05 UTC, Bauss wrote:
 On Monday, 5 January 2015 at 12:54:00 UTC, Gary Willoughby 
 wrote:
 On Monday, 5 January 2015 at 11:49:32 UTC, Bauss wrote:
 Is it possible to compile for other OS's on Windows using dmd?
This is what's known as cross compiling and is not currently supported by DMD at this time.
Any alternatives?
Fire up a VM of the target machine (easy with any of the *nix systems) and compile on that?
Jan 05 2015
prev sibling parent "Joakim" <dlang joakim.fea.st> writes:
On Monday, 5 January 2015 at 15:00:05 UTC, Bauss wrote:
 On Monday, 5 January 2015 at 12:54:00 UTC, Gary Willoughby 
 wrote:
 On Monday, 5 January 2015 at 11:49:32 UTC, Bauss wrote:
 Is it possible to compile for other OS's on Windows using dmd?
This is what's known as cross compiling and is not currently supported by DMD at this time.
Any alternatives?
You might be able to lightly tweak ldc to do it: I was able to cross-compile druntime/phobos, their unit tests, and some small sample apps on a linux/x86 host to run on a linux/ARM target. The problem isn't really the D compiler so much as the other needed tools and environment. Dmd and the other D compilers are automatically configured to use your system linker and link against the system's C standard library. Well, optlink or the Microsoft linker on Windows don't know how to link for linux or OS X! So you have to set up linkers and C libraries for every other OS you want to build for on Windows. It's possible: the Android NDK can be installed on Windows with Cygwin and compile C/C++ code for the various Android architectures. But none of the D compilers have gone to all the trouble to provide that cross-compiling support out of the box for all the various OSs they support. It's easier to just run each OS in a VM on top of Windows, as Colin said.
Jan 05 2015