Skip to content

Commit

Permalink
add check step
Browse files Browse the repository at this point in the history
  • Loading branch information
jiacai2050 committed Jul 7, 2024
1 parent e577a80 commit f0ebde2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions book-src/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ When working on zig-cookbook, we benefit a lot from several similar projects, th

- [Rust Cookbook](https://github.com/rust-lang-nursery/rust-cookbook)

# Star History

[![Star History Chart](https://api.star-history.com/svg?repos=zigcc/zig-cookbook&type=Date)](https://star-history.com/#zigcc/zig-cookbook&Date)

# License

The markdown files are licensed under [CC BY-NC-ND 4.0 DEED](https://creativecommons.org/licenses/by-nc-nd/4.0/), and zig files are under MIT.
3 changes: 3 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ fn addExample(b: *std.Build, run_all: *std.Build.Step) !void {

const target = b.standardTargetOptions(.{});
var it = src_dir.iterate();
const check = b.step("check", "Check if it compiles");

while (try it.next()) |entry| {
switch (entry.kind) {
.file => {
Expand All @@ -25,6 +27,7 @@ fn addExample(b: *std.Build, run_all: *std.Build.Step) !void {
.target = target,
.optimize = .Debug,
});
check.dependOn(&exe.step);
var opts = b.addOptions();
opts.addOption(bool, "is_latest_zig", is_latest_zig);
exe.root_module.addOptions("build-info", opts);
Expand Down

0 comments on commit f0ebde2

Please sign in to comment.