Compare commits

...

3 Commits

Author SHA1 Message Date
rawan10101
c1ccce24e1 build(emscripten): remove unix/posix-poll.c from Emscripten sources
Some checks failed
CI / build (-Dbuild-tests -Dbuild-benchmarks, true, macos-latest, 0.15.2) (push) Has been cancelled
CI / build (macos-latest, 0.14.1) (push) Has been cancelled
CI / build (macos-latest, master) (push) Has been cancelled
CI / build (ubuntu-latest, 0.14.1) (push) Has been cancelled
CI / build (ubuntu-latest, 0.15.2) (push) Has been cancelled
CI / build (ubuntu-latest, master) (push) Has been cancelled
CI / build (windows-latest, 0.14.1) (push) Has been cancelled
CI / build (windows-latest, 0.15.2) (push) Has been cancelled
CI / build (windows-latest, master) (push) Has been cancelled
2026-06-19 14:00:24 +03:00
b465d9ae43 update to libuv 1.52.1
Fixes: #10
2026-03-07 11:21:08 -07:00
Rawan10101
e4dc0ddc67 build: add Emscripten/WASM support
The wasm build requires the Emscripten SDK to be available. Then the
library can be built with something like:

   zig build -Dtarget=wasm32-emscripten --search-prefix $EMSDK/upstream/emscripten/cache/sysroot
2026-03-04 22:58:04 -07:00
2 changed files with 21 additions and 2 deletions

View File

@@ -130,6 +130,18 @@ pub fn build(b: *std.Build) void {
"uv/linux.h",
);
},
.emscripten => {
root_module.addCMacro("UV_PLATFORM_LOOP_FIELDS", "struct pollfd* poll_fds; size_t poll_fds_used; size_t poll_fds_size; unsigned char poll_fds_iterating;");
root_module.addCSourceFiles(.{
.root = src_root,
.files = emscripten_sources,
.flags = cflags,
});
lib.installHeader(
include_root.path(b, "uv/posix.h"),
"uv/posix.h",
);
},
.haiku => {
root_module.addCMacro("_BSD_SOURCE", "");
root_module.linkSystemLibrary("bsd", .{});
@@ -440,6 +452,12 @@ const solaris_sources: []const []const u8 = &.{
"unix/sunos.c",
};
const emscripten_sources: []const []const u8 = &.{
"unix/no-fsevents.c",
"unix/no-proctitle.c",
"unix/posix-hrtime.c",
};
const haiku_sources: []const []const u8 = &.{
"unix/haiku.c",
"unix/bsd-ifaddrs.c",
@@ -718,6 +736,7 @@ const test_sources: []const []const u8 = &.{
"test-udp-send-immediate.c",
"test-udp-sendmmsg-error.c",
"test-udp-send-unreachable.c",
"test-udp-recv-cb-close-pollerr.c",
"test-udp-try-send.c",
"test-udp-recv-in-a-row.c",
"test-udp-recvmsg-unreachable-error.c",

View File

@@ -5,8 +5,8 @@
.minimum_zig_version = "0.14.0",
.dependencies = .{
.libuv = .{
.url = "git+https://github.com/libuv/libuv?ref=v1.52.0#b556c0629d0fd250b5feefbc91b84c6f5e3dae48",
.hash = "N-V-__8AALHpRAD4RWLGxEOQL1GdKH2xwNlq0f51wZBIPIOV",
.url = "git+https://github.com/libuv/libuv?ref=v1.52.1#a19ceeb13a3689cfd20bf96b283136cff08a0dc6",
.hash = "N-V-__8AAF0TRQB7f11_kVHJXTkp9QLCD20udiPXEsoNg9cC",
},
},
.paths = .{