Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/burlindw/zig-build-utils
A collection of common utilities for Zig build scripts inspired by the build scripts used by Zig and ZLS.
https://github.com/burlindw/zig-build-utils
zig zig-package zig-tools
Last synced: about 1 month ago
JSON representation
A collection of common utilities for Zig build scripts inspired by the build scripts used by Zig and ZLS.
- Host: GitHub
- URL: https://github.com/burlindw/zig-build-utils
- Owner: burlindw
- License: mit
- Created: 2024-08-06T03:48:19.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-06T04:39:30.000Z (5 months ago)
- Last Synced: 2024-10-15T19:40:55.995Z (3 months ago)
- Topics: zig, zig-package, zig-tools
- Language: Zig
- Homepage:
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# zig-build-utils
A collection of common utilities for Zig build scripts inspired by the build
scripts used by [Zig](https://github.com/ziglang/zig) and [ZLS](https://github.com/zigtools/zls).## How to use
Run the following command from a project's root to add `zig-build-utils` as
as dependency:```sh
zig fetch --save git+https://github.com/burlindw/zig-build-utils.git
```Import `build-utils` in `build.zig`. It is not necessary to call `std.Build.dependency()`
as there are no exported modules or artifacts.```zig
const std = @import("std");
const utils = @import("build-utils");pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const version = utils.getBuildVersion(b);const exe = b.addExecutable(.{
.name = "your-exe-name",
.target = target,
.optimize = optimize,
.version = version,
.root_source_file = b.path("src/main.zig"),
});
b.installArtifact(exe);
}
```