diff --git a/build.zig b/build.zig index 3f1a6a5f5..cc9cbb595 100644 --- a/build.zig +++ b/build.zig @@ -1157,9 +1157,11 @@ fn addDeps( step.linkLibrary(spirv_cross_dep.artifact("spirv_cross")); try static_libs.append(spirv_cross_dep.artifact("spirv_cross").getEmittedBin()); - // Sentry - step.linkLibrary(sentry_dep.artifact("sentry")); - try static_libs.append(sentry_dep.artifact("sentry").getEmittedBin()); + if (target.result.os.tag != .windows) { + // Sentry + step.linkLibrary(sentry_dep.artifact("sentry")); + try static_libs.append(sentry_dep.artifact("sentry").getEmittedBin()); + } // Dynamic link if (!config.static) { diff --git a/pkg/sentry/build.zig b/pkg/sentry/build.zig index cec249de1..131dea1ca 100644 --- a/pkg/sentry/build.zig +++ b/pkg/sentry/build.zig @@ -58,6 +58,7 @@ pub fn build(b: *std.Build) !void { "src/sentry_windows_dbghelp.c", "src/path/sentry_path_windows.c", "src/symbolizer/sentry_symbolizer_windows.c", + "src/unwinder/sentry_unwinder_dbghelp.c", }, .flags = flags.items, }); diff --git a/src/sentry.zig b/src/sentry.zig index 589fea3d5..452a28800 100644 --- a/src/sentry.zig +++ b/src/sentry.zig @@ -1,6 +1,7 @@ const std = @import("std"); const assert = std.debug.assert; const Allocator = std.mem.Allocator; +const builtin = @import("builtin"); const build_config = @import("build_config.zig"); const sentry = @import("sentry"); const internal_os = @import("os/main.zig"); @@ -16,6 +17,9 @@ const log = std.log.scoped(.sentry); /// It is up to the user to grab the logs and manually send them to us /// (or they own Sentry instance) if they want to. pub fn init(gpa: Allocator) !void { + // Not supported on Windows currently, doesn't build. + if (comptime builtin.os.tag == .windows) return; + var arena = std.heap.ArenaAllocator.init(gpa); defer arena.deinit(); const alloc = arena.allocator(); @@ -58,6 +62,8 @@ pub fn init(gpa: Allocator) !void { /// Process-wide deinitialization of our Sentry client. This ensures all /// our data is flushed. pub fn deinit() void { + if (comptime builtin.os.tag == .windows) return; + _ = sentry.c.sentry_close(); }