Skip to content

Commit

Permalink
examples/proxy: use zon
Browse files Browse the repository at this point in the history
  • Loading branch information
naoki9911 committed Jul 17, 2024
1 parent e8f5397 commit 7ceecda
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 3 deletions.
4 changes: 1 addition & 3 deletions examples/proxy/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ pub fn build(b: *std.Build) void {
.optimize = optimize,
});

exe.root_module.addAnonymousImport("tls13-server", .{
.root_source_file = b.path("../../src/server.zig"),
});
exe.root_module.addImport("tls13-server", b.dependency("tls13-zig", .{}).module("tls13-server"));
// This declares intent for the executable to be installed into the
// standard location when the user invokes the "install" step (the default
// step when running `zig build`).
Expand Down
39 changes: 39 additions & 0 deletions examples/proxy/build.zig.zon
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.{
// This is the default name used by packages depending on this one. For
// example, when a user runs `zig fetch --save <url>`, this field is used
// as the key in the `dependencies` table. Although the user can choose a
// different name, most users will stick with this provided value.
//
// It is redundant to include "zig" in this name because it is already
// within the Zig package namespace.
.name = "proxy",

// This is a [Semantic Version](https://semver.org/).
// In a future version of Zig it will be used for package deduplication.
.version = "0.0.0",

// This field is optional.
// This is currently advisory only; Zig does not yet do anything
// with this value.
//.minimum_zig_version = "0.11.0",

// This field is optional.
// Each dependency must either provide a `url` and `hash`, or a `path`.
// `zig build --fetch` can be used to fetch all dependencies of a package, recursively.
// Once all dependencies are fetched, `zig build` no longer requires
// internet connectivity.
.dependencies = .{
.@"tls13-zig" = .{
.url = "https://github.com/shiguredo/tls13-zig/archive/refs/heads/develop.zip",
.hash = "12205605c99759d35ef65bbe7ea8d2f17aed2e7e63aa354fdb96d94eea7761af5ec9",
},
},
.paths = .{
"build.zig",
"build.zig.zon",
"src",
// For example...
//"LICENSE",
//"README.md",
},
}

0 comments on commit 7ceecda

Please sign in to comment.