dub cross compilation binary extension

Andre Pany andre at s-e-a-p.de
Fri Sep 29 21:01:43 UTC 2017


On Wednesday, 27 September 2017 at 04:08:39 UTC, Joakim wrote:
> 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.

Thanks for the information. I wasn't sure I might miss some 
config value in dub json. I will create a dub issue. Maybe some 
new config parameter "targetExtension" makes sense to override 
the operation system specific executable file extension.

Kind regards
Andre


More information about the Digitalmars-d-learn mailing list