enet
This commit is contained in:
1 parent
b91bce8840
commit
510c19fbd5
3 files changed
+62
-95
No files matched your search
Vendored
+30
-1
@@ -1,6 +1,6 @@
|
||||
const std = @import("std");
|
||||
|
||||
pub fn build(b: *std.Build) void {
|
||||
pub fn build(b: *std.Build) !void {
|
||||
const target = b.standardTargetOptions(.{});
|
||||
const optimize = b.standardOptimizeOption(.{});
|
||||
|
||||
@@ -15,6 +15,24 @@ pub fn build(b: *std.Build) void {
|
||||
}),
|
||||
});
|
||||
|
||||
var flags = try std.ArrayList([]const u8).initCapacity(b.allocator, 0);
|
||||
|
||||
switch (target.result.os.tag) {
|
||||
.linux, .macos => {
|
||||
try flags.append(b.allocator, "-DHAS_FCNTL=1");
|
||||
try flags.append(b.allocator, "-DHAS_POLL=1");
|
||||
try flags.append(b.allocator, "-DHAS_GETADDRINFO=1");
|
||||
try flags.append(b.allocator, "-DHAS_GETNAMEINFO=1");
|
||||
try flags.append(b.allocator, "-DHAS_INET_PTON=1");
|
||||
try flags.append(b.allocator, "-DHAS_INET_NTOP=1");
|
||||
try flags.append(b.allocator, "-DHAS_MSGHDR_FLAGS=1");
|
||||
},
|
||||
else => {},
|
||||
}
|
||||
|
||||
try flags.append(b.allocator, "-DHAS_OFFSETOF=1");
|
||||
try flags.append(b.allocator, "-DHAS_SOCKLEN_T=1");
|
||||
|
||||
lib.root_module.addCSourceFiles(.{
|
||||
.root = enet_src.path(""),
|
||||
.files = &[_][]const u8{
|
||||
@@ -28,6 +46,17 @@ pub fn build(b: *std.Build) void {
|
||||
"unix.c",
|
||||
"win32.c",
|
||||
},
|
||||
.flags = &[_][]const u8{
|
||||
"-DHAS_OFFSETOF=1",
|
||||
"-DHAS_SOCKLEN_T=1",
|
||||
"-DHAS_FCNTL=1",
|
||||
"-DHAS_POLL=1",
|
||||
"-DHAS_GETADDRINFO=1",
|
||||
"-DHAS_GETNAMEINFO=1",
|
||||
"-DHAS_INET_PTON=1",
|
||||
"-DHAS_INET_NTOP=1",
|
||||
"-DHAS_MSGHDR_FLAGS=1",
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user