Compile for other OS's on Windows?
Joakim via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Mon Jan 5 09:08:20 PST 2015
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.
More information about the Digitalmars-d-learn
mailing list