From 5aa692b4e5c8f28eca017511b19ba99e96ab9269 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Sat, 6 Aug 2022 17:52:51 -0700 Subject: [PATCH] gpu-dawn: workaround missing pthread issue in abseil-cpp abseil-cpp now depends on `pthread.h`, it previously didn't. But this appears to be a bug in abseil of sorts, because if you have `ABSL_FORCE_THREAD_IDENTITY_MODE` set to `ABSL_THREAD_IDENTITY_MODE_USE_CPP11` it doesn't appear to be used/needed. [Zig doesn't ship with pthread for the MinGW / `x86_64-windows-gnu` target](https://github.com/ziglang/zig/issues/10989), and so the header is missing - but we don't actually need it, so we just add an empty file to prevent the missing include error. Signed-off-by: Stephen Gutekanst --- gpu-dawn/build.zig | 1 + gpu-dawn/src/dawn/zig_mingw_pthread/pthread.h | 0 2 files changed, 1 insertion(+) create mode 100644 gpu-dawn/src/dawn/zig_mingw_pthread/pthread.h diff --git a/gpu-dawn/build.zig b/gpu-dawn/build.zig index b24e764a..977db2c9 100644 --- a/gpu-dawn/build.zig +++ b/gpu-dawn/build.zig @@ -1130,6 +1130,7 @@ fn buildLibAbseilCpp(b: *Builder, step: *std.build.LibExeObjStep, options: Optio "-DD3D10_ARBITRARY_HEADER_ORDERING", "-D_CRT_SECURE_NO_WARNINGS", "-DNOMINMAX", + include("src/dawn/zig_mingw_pthread"), }) catch unreachable; // absl diff --git a/gpu-dawn/src/dawn/zig_mingw_pthread/pthread.h b/gpu-dawn/src/dawn/zig_mingw_pthread/pthread.h new file mode 100644 index 00000000..e69de29b