diff --git a/src/gallium/drivers/d3d12/d3d12_screen.cpp b/src/gallium/drivers/d3d12/d3d12_screen.cpp index d4b30fdadd0..3d492405ea8 100644 --- a/src/gallium/drivers/d3d12/d3d12_screen.cpp +++ b/src/gallium/drivers/d3d12/d3d12_screen.cpp @@ -876,7 +876,7 @@ d3d12_flush_frontbuffer(struct pipe_screen * pscreen, winsys->displaytarget_unmap(winsys, res->dt); } -#if defined(_WIN32) && !defined(_GAMING_XBOX) +#if defined(_WIN32) && !defined(_GAMING_XBOX) && defined(HAVE_GALLIUM_D3D12_GRAPHICS) // WindowFromDC is Windows-only, and this method requires an HWND, so only use it on Windows ID3D12SharingContract *sharing_contract; if (SUCCEEDED(screen->cmdqueue->QueryInterface(IID_PPV_ARGS(&sharing_contract)))) {