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
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
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
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
**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
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
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
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