Skip to content

Commit

Permalink
Use imported zig-network instead of submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
g41797 committed Oct 8, 2024
1 parent 7541892 commit d7e7a4c
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 7 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "src/deps/zig-network"]
path = src/deps/zig-network
url = https://github.com/ikskuh/zig-network
1 change: 1 addition & 0 deletions _notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ Import

zig fetch --save=zig-datetime git+https://github.com/frmdstryr/zig-datetime

zig fetch --save=network git+https://github.com/ikskuh/zig-network



7 changes: 7 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ pub fn build(b: *std.Build) void {
.optimize = optimize,
});

const zig_network = b.dependency("network", .{
.target = target,
.optimize = optimize,
});

const lib = b.addStaticLibrary(.{
.name = "syslog",
// In this case the main source file is merely a path, however, in more
Expand All @@ -35,6 +40,7 @@ pub fn build(b: *std.Build) void {
});

lib.root_module.addImport("zig-datetime", zig_datetime.module("zig-datetime"));
lib.root_module.addImport("network", zig_network.module("network"));

// This declares intent for the library to be installed into the standard
// location when the user invokes the "install" step (the default step when
Expand All @@ -49,6 +55,7 @@ pub fn build(b: *std.Build) void {
.optimize = optimize,
});

lib_unit_tests.root_module.addImport("network", zig_network.module("network"));
lib_unit_tests.root_module.addImport("zig-datetime", zig_datetime.module("zig-datetime"));
lib_unit_tests.root_module.addImport("mailbox", mailbox.module("mailbox"));

Expand Down
6 changes: 5 additions & 1 deletion build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@
.hash = "12208d8777b69f62cccf70b4372d8c31a22bb022881279713d424689d6555532d389",
},
.@"zig-datetime" = .{
.url = "git+https://github.com/frmdstryr/zig-datetime#70aebf28fb3e137cd84123a9349d157a74708721",
.url = "git+https://github.com/frmdstryr/zig-datetime",
.hash = "122077215ce36e125a490e59ec1748ffd4f6ba00d4d14f7308978e5360711d72d77f",
},
.network = .{
.url = "git+https://github.com/ikskuh/zig-network#805ce63eec48373ec497542f18f19d7c484b9b2e",
.hash = "122007f014c736cee735f1fe71660e39aa9f8c9351deab2e35c4dd9ab69d37d8db46",
},
},
.paths = .{
"build.zig",
Expand Down
1 change: 0 additions & 1 deletion src/deps/zig-network
Submodule zig-network deleted from 805ce6
2 changes: 1 addition & 1 deletion src/syslog_tests.zig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const mailbox = @import("mailbox");
const syslog = @import("syslog.zig");
const transport = @import("transport.zig");
const rfc = @import("rfc5424.zig");
const network = @import("deps/zig-network/network.zig");
const network = @import("network");
//---------------------------------

const Thread = std.Thread;
Expand Down
2 changes: 1 addition & 1 deletion src/transport.zig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//---------------------------------
const std = @import("std");
pub const network = @import("deps/zig-network/network.zig");
pub const network = @import("network");
//---------------------------------

//---------------------------------
Expand Down

0 comments on commit d7e7a4c

Please sign in to comment.