dub cross compilation binary extension

Joakim dlang at joakim.fea.st
Wed Sep 27 04:08:39 UTC 2017


On Tuesday, 26 September 2017 at 17:48:06 UTC, Andre Pany wrote:
> Hi,
>
> I had set up a cross compilation from Windows to Raspberry Pi 
> using LDC and GCC toolchain. Almost everything is working fine. 
> Dub creates a binary which is runnable on the Raspberry Pi. 
> There is only 1 small issue. Dub creates the executable with 
> the windows file extension ".exe".
> Is there anything I can do to force dub not to include the 
> windows file extension?
>
> dub.json
> {
> 	"name": "test",
> 	"dflags-ldc": ["-mtriple=arm-linux-gnueabihf", 
> "-gcc=arm-linux-gnueabihf-gcc"],
> 	"lflags-ldc": 
> ["-LC:\\D\\ldc2-1.4.0-beta1-win32-msvc\\bin\\ldc-build-runtime.tmp\\lib\\"]
> }
>
> dub build --compiler=ldc2 -v
>
> My current workaround is to have a batch file which renames the 
> file automatically. But I want to write a blog post and this 
> workaround looks ugly.
>
> Kind regards
> André

Dub is not meant for cross-compilation yet, it will need patches. 
I'm surprised just passing those flags worked.

I mean to look at it and submit a pull.  Until then, renaming 
will be needed, or you could submit a pull for that yourself.


More information about the Digitalmars-d-learn mailing list