-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from Hanaasagi/zig-0.11
chore: move to zig 0.11 new build API.
- Loading branch information
Showing
3 changed files
with
30 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,32 @@ | ||
const std = @import("std"); | ||
|
||
pub fn build(b: *std.build.Builder) void { | ||
// Standard release options allow the person running `zig build` to select | ||
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. | ||
const mode = b.standardReleaseOptions(); | ||
const target = b.standardTargetOptions(.{}); | ||
|
||
const lib = b.addStaticLibrary("zig-deque", "src/deque.zig"); | ||
lib.setBuildMode(mode); | ||
lib.install(); | ||
const optimize = b.standardOptimizeOption(.{}); | ||
|
||
const main_tests = b.addTest("src/deque.zig"); | ||
main_tests.setBuildMode(mode); | ||
_ = b.addModule("zig-deque", .{ | ||
.source_file = .{ .path = "src/deque.zig" }, | ||
.dependencies = &.{}, | ||
}); | ||
|
||
const lib = b.addStaticLibrary(.{ | ||
.name = "zig-deque", | ||
.root_source_file = .{ .path = "src/deque.zig" }, | ||
.target = target, | ||
.optimize = optimize, | ||
}); | ||
|
||
b.installArtifact(lib); | ||
|
||
const main_tests = b.addTest(.{ | ||
.root_source_file = .{ .path = "src/deque.zig" }, | ||
.target = target, | ||
.optimize = optimize, | ||
}); | ||
|
||
const run_main_tests = b.addRunArtifact(main_tests); | ||
|
||
const test_step = b.step("test", "Run library tests"); | ||
test_step.dependOn(&main_tests.step); | ||
test_step.dependOn(&run_main_tests.step); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.{ | ||
.name = "zig-deque", | ||
.version = "0.1.0", | ||
.dependencies = .{}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters