# std.Build: support exposing and depending on zig modules · gitcafe/zig

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

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

Visibility: public

Requested revision: 693b12f8e1c1d99d33c01961c1fdc972a5255eb6

Requested commit: 693b12f8e1c1d99d33c01961c1fdc972a5255eb6

Commit: 693b12f8e1c1d99d33c01961c1fdc972a5255eb6

Tree: da0106bbc81d8830be509ffda0d7c0107a7400db

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
std.Build: support exposing and depending on zig modules

New API introduced: std.Build.addModule

This function exposes a zig module with the given name, which can be
used by packages that depend on this one via std.Build.Dependency.module.

std.Build.Pkg and related functionality is deleted. Every use case has a
straightforward upgrade path using the new Module struct.

std.Build.OptionsStep.getPackage is replaced by
std.Build.OptionsStep.createModule.

std.Build.CompileStep.addPackagePath is replaced by
std.Build.CompileStep.addAnonymousModule.

This partially addresses #14307 by renaming some of the instances of
"package" to "module".

Closes #14278

```

## Parents

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

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