Re: DUB: Sometimes generates .di file and sometimes do not.

2023-11-06 Thread BoQsc via Digitalmars-d-learn
To test the behaviour of static library. **program.d** ``` module program; import std.stdio; import library; void main(string[] args) { writeln("func(3) = ", library.func(3)); } ``` **Command Line:** ``` dmd "./program.d" "./builds/library.di" "./builds/library.lib" -ofProgram.exe

Re: DUB: Sometimes generates .di file and sometimes do not.

2023-11-06 Thread BoQsc via Digitalmars-d-learn
In summary this is what it all combined could look like. **dub.sdl** ``` name "dheaders" description "generates .di header file for a static library." authors "public domain" copyright "Public Domain. No rights reserved." license "public domain" configuration "staticLibrary" { dflags

Re: DUB: Sometimes generates .di file and sometimes do not.

2023-11-06 Thread BoQsc via Digitalmars-d-learn
Update: To allow only `.di` (D Header) output: Instead of configuration, it would be more correct to make a new `build type`. ``` buildType "headerFileOnly" { extraDependencyFiles "$PACKAGE_DIR/builds/library.di" dflags "-Hf=$PACKAGE_DIR/builds/library.di" dflags

Re: DUB: Sometimes generates .di file and sometimes do not.

2023-11-05 Thread BoQsc via Digitalmars-d-learn
Configuration to generate only `.di` (D Header file) ``` name "dheaders" description "generates .di header file for a static library." authors "public domain" copyright "Public Domain. No rights reserved." license "public domain" configuration "staticLibrary" { dflags

Re: DUB: Sometimes generates .di file and sometimes do not.

2023-11-05 Thread BoQsc via Digitalmars-d-learn
**Conclusive observation:** This can be resolved by informing `dub` of `extraDependencyFiles` to rebuild itself. `library.di` non-existance simply does not trigger rebuild of the package and instead only `library.lib` is being copied from the `cache` folder into `build` folder. Leaving

Re: DUB: Sometimes generates .di file and sometimes do not.

2023-11-05 Thread BoQsc via Digitalmars-d-learn
On Sunday, 5 November 2023 at 10:54:35 UTC, Imperatorn wrote: On Sunday, 5 November 2023 at 10:53:33 UTC, BoQsc wrote: I would like to know how to solve this problem with `dub`. **dub.sdl** ``` name "dheaders" description "generates .di header file for a static library." authors "public

Re: DUB: Sometimes generates .di file and sometimes do not.

2023-11-05 Thread Imperatorn via Digitalmars-d-learn
On Sunday, 5 November 2023 at 10:53:33 UTC, BoQsc wrote: I would like to know how to solve this problem with `dub`. **dub.sdl** ``` name "dheaders" description "generates .di header file for a static library." authors "public domain" copyright "Public Domain. No rights reserved." license

DUB: Sometimes generates .di file and sometimes do not.

2023-11-05 Thread BoQsc via Digitalmars-d-learn
I would like to know how to solve this problem with `dub`. **dub.sdl** ``` name "dheaders" description "generates .di header file for a static library." authors "public domain" copyright "Public Domain. No rights reserved." license "public domain" configuration "staticLibrary" { dflags