-
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.
Update to Zig 0.13, add support for build system
- Loading branch information
Showing
14 changed files
with
804 additions
and
736 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,3 +1,4 @@ | ||
# Specify filepatterns you want git to ignore. | ||
|
||
zig-cache/ | ||
.zig-cache/ | ||
zig-out/ |
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,2 +1,4 @@ | ||
# LZig4 | ||
Implementing lz4 in zig. | ||
|
||
Currently supports Zig 0.13 |
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,50 @@ | ||
const std = @import("std"); | ||
|
||
pub fn build(b: *std.Build) void { | ||
const target = b.standardTargetOptions(.{}); | ||
|
||
const optimize = b.standardOptimizeOption(.{}); | ||
|
||
const exe = b.addExecutable(.{ | ||
.name = "lz4", | ||
.root_source_file = b.path("src/main.zig"), | ||
.target = target, | ||
.optimize = optimize, | ||
}); | ||
|
||
const clap_dep = b.dependency("clap", .{ | ||
.target = target, | ||
.optimize = optimize, | ||
}); | ||
|
||
const lzig4_module = b.addModule("lzig4", .{ | ||
.root_source_file = b.path("lib/root.zig"), | ||
}); | ||
|
||
exe.root_module.addImport("clap", clap_dep.module("clap")); | ||
exe.root_module.addImport("lzig4", lzig4_module); | ||
|
||
b.installArtifact(exe); | ||
|
||
const run_cmd = b.addRunArtifact(exe); | ||
|
||
run_cmd.step.dependOn(b.getInstallStep()); | ||
|
||
if (b.args) |args| { | ||
run_cmd.addArgs(args); | ||
} | ||
|
||
const run_step = b.step("run", "Run the app"); | ||
run_step.dependOn(&run_cmd.step); | ||
|
||
const lib_unit_tests = b.addTest(.{ | ||
.root_source_file = b.path("lib/root.zig"), | ||
.target = target, | ||
.optimize = optimize, | ||
}); | ||
|
||
const run_lib_unit_tests = b.addRunArtifact(lib_unit_tests); | ||
|
||
const test_step = b.step("test", "Run unit tests"); | ||
test_step.dependOn(&run_lib_unit_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,16 @@ | ||
.{ | ||
.name = "LZig4", | ||
.version = "0.0.8", | ||
|
||
.paths = [][]const u8{ | ||
"build.zig", | ||
"build.zig.zon", | ||
}, | ||
|
||
.dependencies = .{ | ||
.clap = .{ | ||
.url = "https://github.com/Hejsil/zig-clap/archive/c0193e9247335a6c1688b946325060289405de2a.tar.gz", | ||
.hash = "12207ee987ce045596cb992cfb15b0d6d9456e50d4721c3061c69dabc2962053644d", | ||
}, | ||
}, | ||
} |
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
File renamed without changes.
File renamed without changes.
Oops, something went wrong.