dub libs from home directory on windows

evilrat evilrat666 at gmail.com
Thu Mar 19 02:56:06 UTC 2020


On Wednesday, 18 March 2020 at 19:53:58 UTC, jmh530 wrote:
> On Wednesday, 18 March 2020 at 15:10:52 UTC, Виталий Фадеев 
> wrote:
>> On Wednesday, 18 March 2020 at 13:52:20 UTC, Abby wrote:
>>>
>>> I cannot build my app, so I was wondering if there is some 
>>> clever way to solve this without hardcoded path to my profile 
>>> name.
>>>
>>> Thank you very much for your help.
>>
>> I see, you want without hardcoded path...
>
> I usually something like ./folder/file.extension to avoid a 
> hardcoded path.
>
> I also recommend taking a look at some other dub files to get a 
> sense of how others do it.

Even better option is to just use "libs" section as usual(no 
paths, just names) and set environment variable specific to your 
machine prior to build.
For MS linker it is 'LIB' with semicolon as delimiter, for Linux 
it is 'LIBRARY_PATH'.

This way it is much more 'portable' and CI friendly, though it 
definitely will add confusion and 'annoyance' for first time 
users.

example batch:

   set LIB=C:\someproject\libs;E:\superduper\lib64
   dub build



More information about the Digitalmars-d-learn mailing list