deps.labjack: support building for windows

The only pthread functionality this seems to use is mutexes, which are
(fortunately) theoretically trivial to wrap for windows. This
compiles, though it is not clear if it actually works correctly.
This commit is contained in:
2024-07-01 19:28:30 -07:00
parent 7275d1c30e
commit c32390f7c1
3 changed files with 44 additions and 1 deletions

View File

@@ -17,6 +17,10 @@ pub fn build(b: *std.Build) !void {
.link_libc = true,
});
if (target.result.os.tag == .windows) {
libljacklm.defineCMacro("LJACKLM_USE_WINDOWS_MUTEX_SHIM", "1");
}
libljacklm.addCSourceFile(.{ .file = b.path("libljacklm/ljacklm.c") });
libljacklm.installHeader(b.path("libljacklm/ljacklm.h"), "ljacklm.h");