# std.Build: add API to create Compile steps from existing module · gitcafe/zig

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

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

Visibility: public

Requested revision: 6168b8ef86e2ca262585387d12166123842773d1

Requested commit: 6168b8ef86e2ca262585387d12166123842773d1

Commit: 6168b8ef86e2ca262585387d12166123842773d1

Tree: 52d0003c1350df2ab579d3a58ddbb3c57f9f80d6

Author: mlugg

Committer: Eric Joldasov

## Message

```
std.Build: add API to create Compile steps from existing module

This commit amends `std.Build.ExecutableOptions` etc to have a new
field, `root_module`, which allows artifacts to be created whose root
module is an existing `*Module` rather than a freshly constructed one.
This API can be far more versatile, allowing construction of complex
module graphs before creating any compile steps, and therefore also
allowing easy reuse of modules.

The fields which correspond to module options, such as
`root_source_file`, are all considered deprecated. They may not be
populated at the same time as the `root_module` field. In the next
release cycle, these deprecated fields will be removed, and the
`root_module` field made non-optional.

```

## Parents

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

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