DMD as cross-compiler
H. S. Teoh
hsteoh at quickfur.ath.cx
Wed Nov 11 19:16:55 UTC 2020
On Wed, Nov 11, 2020 at 05:11:51PM +0000, Adam D. Ruppe via Digitalmars-d wrote:
> On Wednesday, 11 November 2020 at 16:57:53 UTC, Stefan Koch wrote:
> > But what would be a target?
> > ARM?
> > MIPS?
>
> Windows, Linux, and Mac I'd imagine.
>
> I tend to just run `wine dmd` to do linux-> windows but it might still
> be useful anyway.
I prefer LDC for cross-compiling, as it can do both Windows and Android
cross-compile.
> this reminds me i still need to make my generic ldc x-compile setup
> program.
I just download and unpack both the Linux and Windows versions of LDC,
then add this to ldc2.conf (for Linux version):
"(i686|x86_64)-.*-windows.msvc":
{
switches = [
"-defaultlib=phobos2-ldc,druntime-ldc",
"-link-defaultlib-shared=false",
];
lib-dirs = [
"/path/to/ldc2-1.24.0-windows-x64/lib",
];
};
Then just compile with `-mtriple=x84_64-windows-msvc` and it Just
Works(tm). It's been awesome.
T
--
VI = Visual Irritation
More information about the Digitalmars-d
mailing list