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 "-Hf=$PACKAGE_DIR/builds/library.di"
        targetName "library"
        targetType "library"
        targetPath "builds"
        sourceFiles "library.d"       
        extraDependencyFiles "$PACKAGE_DIR/builds/library.di"
        dflags "-o-"
}
```





[-o- Suppress generation of object file. Useful in conjuction with -D or -H flags.](https://dlang.org/dmd-windows.html#switch-o-)

Similarly [`buildOptions "syntaxOnly"`](https://dub.pm/package-format-sdl#build-options) can also be used in-place of `dflag "-o-"` they are correspondingly the same.


```
configuration "staticLibrary" {
        dflags "-Hf=$PACKAGE_DIR/builds/library.di"
        targetName "library"
        targetType "library"
        targetPath "builds"
        sourceFiles "library.d"       
        extraDependencyFiles "$PACKAGE_DIR/builds/library.di"
        buildOptions "syntaxOnly"
}
```

Reply via email to