diff --git a/librashader-cache/Cargo.toml b/librashader-cache/Cargo.toml index 1266a72..7f150c7 100644 --- a/librashader-cache/Cargo.toml +++ b/librashader-cache/Cargo.toml @@ -12,7 +12,7 @@ description = "RetroArch shaders for all." [dependencies] serde = { version = "1.0" } -librashader-reflect = { path = "../librashader-reflect", version = "0.1.4", features = ["serialize", "dxil"] } +librashader-reflect = { path = "../librashader-reflect", version = "0.1.4", features = ["serialize"] } librashader-preprocess = { path = "../librashader-preprocess", version = "0.1.4" } platform-dirs = "0.3.0" blake3 = { version = "1.3.3" } @@ -32,7 +32,7 @@ features = [ optional = true [features] -d3d = ["windows"] +d3d = ["windows", "librashader-reflect/dxil"] # hack to get building on docsrs docsrs = ["blake3/pure", "rusqlite/in_gecko"] diff --git a/librashader-cache/src/compilation.rs b/librashader-cache/src/compilation.rs index ef1ad16..8c7dc0f 100644 --- a/librashader-cache/src/compilation.rs +++ b/librashader-cache/src/compilation.rs @@ -1,6 +1,8 @@ //! Cache helpers for `ShaderCompilation` objects to cache compiled SPIRV. use librashader_preprocess::ShaderSource; -use librashader_reflect::back::targets::{DXIL, GLSL, HLSL, SPIRV}; +#[cfg(feature = "windows")] +use librashader_reflect::back::targets::DXIL; +use librashader_reflect::back::targets::{GLSL, HLSL, SPIRV}; use librashader_reflect::back::{CompilerBackend, FromCompilation}; use librashader_reflect::error::{ShaderCompileError, ShaderReflectError}; use librashader_reflect::front::{GlslangCompilation, ShaderCompilation}; @@ -56,6 +58,7 @@ impl serde::Deserialize<'de> + serde::Serialize } } +#[cfg(feature = "windows")] impl FromCompilation> for DXIL { type Target = >::Target; type Options = >::Options;