-
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.
- Loading branch information
1 parent
f387897
commit f269809
Showing
7 changed files
with
87 additions
and
61 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
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
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
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
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
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,49 @@ | ||
const std = @import("std"); | ||
const Build = std.Build; | ||
const Module = Build.Module; | ||
const OptimizeMode = std.builtin.OptimizeMode; | ||
|
||
pub fn build(b: *std.Build) void { | ||
const target = b.standardTargetOptions(.{}); | ||
const optimize = b.standardOptimizeOption(.{}); | ||
|
||
const msgpack = b.addModule("msgpack", .{ | ||
.root_source_file = .{ | ||
.path = "src/msgpack.zig", | ||
}, | ||
}); | ||
|
||
generateDocs(b, optimize, target); | ||
|
||
const test_step = b.step("test", "Run unit tests"); | ||
|
||
const msgpack_unit_tests = b.addTest(.{ | ||
.root_source_file = .{ .path = "src/msgpack_unit_test.zig" }, | ||
.target = target, | ||
.optimize = optimize, | ||
}); | ||
msgpack_unit_tests.root_module.addImport("msgpack", msgpack); | ||
const run_msgpack_tests = b.addRunArtifact(msgpack_unit_tests); | ||
test_step.dependOn(&run_msgpack_tests.step); | ||
} | ||
|
||
fn generateDocs(b: *Build, optimize: OptimizeMode, target: Build.ResolvedTarget) void { | ||
const lib = b.addObject(.{ | ||
.name = "zig-msgpack", | ||
.root_source_file = .{ | ||
.path = "src/msgpack.zig", | ||
}, | ||
.target = target, | ||
.optimize = optimize, | ||
}); | ||
|
||
const docs_step = b.step("docs", "Emit docs"); | ||
|
||
const docs_install = b.addInstallDirectory(.{ | ||
.source_dir = lib.getEmittedDocs(), | ||
.install_dir = .prefix, | ||
.install_subdir = "docs", | ||
}); | ||
|
||
docs_step.dependOn(&docs_install.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