zig version 0.11.0-dev.2837+b55b8e774
以 zap 为例
- 新建项目
zig init-exe
- 添加文件
build.zig.zon
.{
.name = "testZap",
.version = "0.0.1",
.dependencies = .{
// zap release-0.0.12-test
.zap = .{
.url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.12-test.tar.gz",
.hash = "12201a5586b87c689c5c9f00075e84affc5207b0e2596efab0355025031da148d072",
},
},
}
- 在
build.zig
中添加 dependency
const zap = b.dependency("zap", .{
.target = target,
.optimize = optimize,
});
exe.addModule("zap", zap.module("zap"));
exe.linkLibrary(zap.artifact("facil.io"));
- zig 暂时不支持 proxy,需要使用全局 vpn