Hipreme's #8 Tip of the day - Using custom runtime with dub projects

Hipreme msnmancini at hotmail.com
Sun Jan 22 18:16:35 UTC 2023


On Sunday, 22 January 2023 at 17:06:13 UTC, evilrat wrote:
> On Sunday, 22 January 2023 at 16:57:56 UTC, Hipreme wrote:
>>
>> The way to use dub's packages is by using the DFLAGS. With 
>> DFLAGS, I can set the import path to my own DRuntime and own 
>> std. That way I can make the dependencies behave more or less 
>> the same, this is an example of what is being done now:
>>
>> Keep in mind that you'll probably need to setup some env 
>> variables such as mine done for making your script a little 
>> more portable to other developer's PCs. I would really like if 
>> there was a way to define global dflags on dub though.
>
> Can't you just use env variable[1] and put into dub dflags like 
> this?
>
> https://github.com/Superbelko/ohmygentool/blob/cc75d915a8df8bdc2bba628df305d421151994a1/dub.json#L11
>
>
> _(note that some of the listed predefines doesn't work in some 
> sections though, a bug maybe?)_
> [1] 
> https://dub.pm/package-format-json.html#environment-variables

Nope. Those DFLAGS environment variable is used to affect 
projects such as my dependencies. For example, my dependency 
needs to be built using my own runtime. The dflags defined in the 
dub.json only affect the current project, not its dependencies


More information about the Digitalmars-d-learn mailing list