Project setup.
This commit is contained in:
commit
5ae1bffab7
5 changed files with 61 additions and 0 deletions
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
# IDEA
|
||||
*.iml
|
||||
|
||||
# Zig
|
||||
zig-out/
|
||||
.zig-cache/
|
3
README.md
Normal file
3
README.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
# pgzql
|
||||
|
||||
PostgreSQL async driver using Tardy runtime.
|
33
build.zig
Normal file
33
build.zig
Normal file
|
@ -0,0 +1,33 @@
|
|||
const std = @import("std");
|
||||
|
||||
pub fn build(b: *std.Build) void {
|
||||
const target = b.standardTargetOptions(.{});
|
||||
const optimize = b.standardOptimizeOption(.{});
|
||||
|
||||
// Initialize pgzql module.
|
||||
const pgzql = b.addModule("pgzql", .{
|
||||
.root_source_file = b.path("src/root.zig"),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
||||
|
||||
// Add tardy library.
|
||||
const tardy = b.dependency("tardy", .{
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
||||
pgzql.addImport("tardy", tardy.module("tardy"));
|
||||
|
||||
const lib_unit_tests = b.addTest(.{
|
||||
.root_source_file = b.path("src/root.zig"),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
||||
lib_unit_tests.root_module.addImport("pgzql", pgzql);
|
||||
lib_unit_tests.root_module.addImport("tardy", tardy.module("tardy"));
|
||||
const run_lib_unit_tests = b.addRunArtifact(lib_unit_tests);
|
||||
run_lib_unit_tests.has_side_effects = true;
|
||||
|
||||
const test_step = b.step("test", "Run unit tests");
|
||||
test_step.dependOn(&run_lib_unit_tests.step);
|
||||
}
|
18
build.zig.zon
Normal file
18
build.zig.zon
Normal file
|
@ -0,0 +1,18 @@
|
|||
.{
|
||||
.name = "pgzql",
|
||||
.version = "0.1.0",
|
||||
|
||||
.dependencies = .{
|
||||
.tardy = .{
|
||||
.url = "git+https://github.com/mookums/tardy?ref=v0.1.0#ae0970d6b3fa5b03625b14e142c664efe1fd7789",
|
||||
.hash = "12207f5afee3b8933c1c32737e8feedc80a2e4feebe058739509094c812e4a8d2cc8",
|
||||
},
|
||||
},
|
||||
|
||||
.paths = .{
|
||||
"build.zig",
|
||||
"build.zig.zon",
|
||||
"src",
|
||||
"README.md",
|
||||
},
|
||||
}
|
1
src/root.zig
Normal file
1
src/root.zig
Normal file
|
@ -0,0 +1 @@
|
|||
const std = @import("std");
|
Loading…
Add table
Reference in a new issue