vulkan-loader: Fix MinGW build

- Fix mingwW64 build of vulkan-loader by not including X/wayland libraries on
  windows.

Co-authored-by: Weijia Wang <9713184+wegank@users.noreply.github.com>
This commit is contained in:
Samuel Evans-Powell 2023-12-07 11:58:17 +08:00
parent 209c66f3b7
commit a0efdd21a1
No known key found for this signature in database
GPG Key ID: 652CB5A9AFCC7234
2 changed files with 5 additions and 5 deletions

View File

@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ vulkan-headers ]
++ lib.optionals (!stdenv.isDarwin) [ libX11 libxcb libXrandr wayland ];
++ lib.optionals stdenv.isLinux [ libX11 libxcb libXrandr wayland ];
cmakeFlags = [ "-DCMAKE_INSTALL_INCLUDEDIR=${vulkan-headers}/include" ]
++ lib.optional stdenv.isDarwin "-DSYSCONFDIR=${moltenvk}/share"
@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
meta = with lib; {
description = "LunarG Vulkan loader";
homepage = "https://www.lunarg.com";
platforms = platforms.unix;
platforms = platforms.unix ++ platforms.windows;
license = licenses.asl20;
maintainers = [ maintainers.ralith ];
broken = (version != vulkan-headers.version);

View File

@ -35,11 +35,11 @@ stdenv.mkDerivation rec {
"ac_cv_func_posix_getgrgid_r=yes"
];
env.NIX_CFLAGS_COMPILE = builtins.toString (
env.NIX_CFLAGS_COMPILE = toString (
# Silence "incompatible integer to pointer conversion passing 'gsize'" when building with Clang.
lib.optionals stdenv.cc.isClang ["-Wno-int-conversion"] ++
lib.optionals stdenv.cc.isClang ["-Wno-int-conversion"]
# Silence fprintf format errors when building for Windows.
lib.optionals stdenv.hostPlatform.isWindows ["-Wno-error=format"]
++ lib.optionals stdenv.hostPlatform.isWindows ["-Wno-error=format"]
);
enableParallelBuilding = true;