Update build system to zig 0.14.0
This commit is contained in:
parent
d02dc51456
commit
8d8beb3dbc
3 changed files with 10 additions and 12 deletions
|
@ -35,14 +35,14 @@ std.debug.print("{s}", .{ascii}); // Output: "Blosse".
|
||||||
In your project directory:
|
In your project directory:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
zig fetch --save https://code.zeptotech.net/zedd/anyascii.zig/archive/v1.1.0.tar.gz
|
zig fetch --save https://code.zeptotech.net/zedd/anyascii.zig/archive/v1.2.0.tar.gz
|
||||||
```
|
```
|
||||||
|
|
||||||
In `build.zig`:
|
In `build.zig`:
|
||||||
|
|
||||||
```zig
|
```zig
|
||||||
// Add anyascii.zig dependency.
|
// Add anyascii dependency.
|
||||||
const anyascii = b.dependency("anyascii.zig", .{
|
const anyascii = b.dependency("anyascii", .{
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
|
|
|
@ -5,7 +5,7 @@ pub fn build(b: *std.Build) void {
|
||||||
const optimize = b.standardOptimizeOption(.{});
|
const optimize = b.standardOptimizeOption(.{});
|
||||||
|
|
||||||
// Anyascii zig module.
|
// Anyascii zig module.
|
||||||
const anyascii = b.addModule("anyascii", .{
|
const anyascii = b.createModule(.{
|
||||||
.root_source_file = b.path("src/lib.zig"),
|
.root_source_file = b.path("src/lib.zig"),
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
|
@ -18,15 +18,10 @@ pub fn build(b: *std.Build) void {
|
||||||
|
|
||||||
// Library unit tests.
|
// Library unit tests.
|
||||||
const lib_unit_tests = b.addTest(.{
|
const lib_unit_tests = b.addTest(.{
|
||||||
.root_source_file = b.path("src/lib.zig"),
|
.root_module = anyascii,
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
lib_unit_tests.linkLibC();
|
|
||||||
lib_unit_tests.addIncludePath(b.path("anyascii"));
|
|
||||||
lib_unit_tests.addCSourceFile(.{
|
|
||||||
.file = b.path("anyascii/anyascii.c"),
|
|
||||||
});
|
|
||||||
const run_lib_unit_tests = b.addRunArtifact(lib_unit_tests);
|
const run_lib_unit_tests = b.addRunArtifact(lib_unit_tests);
|
||||||
|
|
||||||
const test_step = b.step("test", "Run unit tests");
|
const test_step = b.step("test", "Run unit tests");
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
.{
|
.{
|
||||||
.name = "anyascii.zig",
|
.name = .anyascii,
|
||||||
.version = "1.1.0",
|
.version = "1.2.0",
|
||||||
|
|
||||||
|
.fingerprint = 0x99df3919abbbf2ae,
|
||||||
|
|
||||||
.dependencies = .{},
|
.dependencies = .{},
|
||||||
|
|
||||||
.paths = .{
|
.paths = .{
|
||||||
|
|
Loading…
Add table
Reference in a new issue