Project setup.

This commit is contained in:
Madeorsk 2024-12-08 21:38:51 +01:00
commit 5ae1bffab7
Signed by: Madeorsk
GPG key ID: 677E51CA765BB79F
5 changed files with 61 additions and 0 deletions

6
.gitignore vendored Normal file
View file

@ -0,0 +1,6 @@
# IDEA
*.iml
# Zig
zig-out/
.zig-cache/

3
README.md Normal file
View file

@ -0,0 +1,3 @@
# pgzql
PostgreSQL async driver using Tardy runtime.

33
build.zig Normal file
View 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
View 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
View file

@ -0,0 +1 @@
const std = @import("std");