# std.build: support for generated c headers · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/b04e48566c58ed22fdb0dbe7ac866877ad53133c)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: b04e48566c58ed22fdb0dbe7ac866877ad53133c

Requested commit: b04e48566c58ed22fdb0dbe7ac866877ad53133c

Commit: b04e48566c58ed22fdb0dbe7ac866877ad53133c

Tree: a277985b27136dce3930578cea2a6d374b2a4ff8

Author: David Vanderson

Committer: Andrew Kelley

## Message

````
std.build: support for generated c headers

Add ability to generate a c header file from scratch, and then both
compile with it and install it if needed.

Example:
```zig
    const avconfig_h = b.addConfigHeader(.{ .path = "libavutil/avconfig.h" }, .generated, .{
        .AV_HAVE_BIGENDIAN = 0, // TODO: detect based on target
        .AV_HAVE_FAST_UNALIGNED = 1, // TODO: detect based on target
    });

    lib.addConfigHeader(avconfig_h);

    lib.installConfigHeader(avconfig_h);
```

````

## Parents

- [11cc1c16fa36a7eb13cba1c43fb153ee6aca7b58](https://git.cafe/gitcafe/zig/commit/11cc1c16fa36a7eb13cba1c43fb153ee6aca7b58?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/b04e48566c58ed22fdb0dbe7ac866877ad53133c?format=markdown)
