From 45e5de0f21e9b2603f0a435718f67390da66df60 Mon Sep 17 00:00:00 2001 From: chyyran Date: Sat, 14 Jan 2023 19:05:15 -0500 Subject: [PATCH] docs: define windows targets --- librashader-capi/Cargo.toml | 3 +++ librashader-common/Cargo.toml | 5 ++++- librashader-common/src/lib.rs | 4 ++-- librashader-runtime-d3d11/Cargo.toml | 4 ++++ librashader-runtime-gl/Cargo.toml | 3 +++ librashader-runtime-vk/Cargo.toml | 2 ++ librashader/Cargo.toml | 4 +++- 7 files changed, 21 insertions(+), 4 deletions(-) diff --git a/librashader-capi/Cargo.toml b/librashader-capi/Cargo.toml index e3cdf9e..ae7ea2e 100644 --- a/librashader-capi/Cargo.toml +++ b/librashader-capi/Cargo.toml @@ -47,3 +47,6 @@ optional = true [package.metadata.cargo-post.dependencies] cbindgen = { git = "https://github.com/eqrion/cbindgen" } + +[package.metadata.docs.rs] +targets = ["x86_64-pc-windows-msvc", "x86_64-unknown-linux-gnu"] \ No newline at end of file diff --git a/librashader-common/Cargo.toml b/librashader-common/Cargo.toml index b16c8bb..b9303e8 100644 --- a/librashader-common/Cargo.toml +++ b/librashader-common/Cargo.toml @@ -24,7 +24,7 @@ ash = { version = "0.37.1+1.3.235", optional = true } num-traits = "0.2.15" -[dependencies.windows] +[target.'cfg(windows)'.dependencies.windows] optional = true version = "0.43.0" features = [ @@ -33,3 +33,6 @@ features = [ "Win32_Graphics_Direct3D", "Win32_Graphics_Direct3D11", ] + +[package.metadata.docs.rs] +targets = ["x86_64-pc-windows-msvc", "x86_64-unknown-linux-gnu"] \ No newline at end of file diff --git a/librashader-common/src/lib.rs b/librashader-common/src/lib.rs index 9e209c7..857666f 100644 --- a/librashader-common/src/lib.rs +++ b/librashader-common/src/lib.rs @@ -7,11 +7,11 @@ pub mod gl; pub mod vk; /// DXGI common conversions. -#[cfg(feature = "dxgi")] +#[cfg(all(target_os = "windows", feature = "dxgi"))] pub mod dxgi; /// Direct3D 11 common conversions. -#[cfg(feature = "d3d11")] +#[cfg(all(target_os = "windows", feature = "d3d11"))] pub mod d3d11; mod viewport; diff --git a/librashader-runtime-d3d11/Cargo.toml b/librashader-runtime-d3d11/Cargo.toml index 4d5bb29..b2e8650 100644 --- a/librashader-runtime-d3d11/Cargo.toml +++ b/librashader-runtime-d3d11/Cargo.toml @@ -41,3 +41,7 @@ features = [ [dev-dependencies] gfx-maths = "0.2.8" + +[package.metadata.docs.rs] +default-target = "x86_64-pc-windows-msvc" +targets = [] \ No newline at end of file diff --git a/librashader-runtime-gl/Cargo.toml b/librashader-runtime-gl/Cargo.toml index bd27a1d..52ad605 100644 --- a/librashader-runtime-gl/Cargo.toml +++ b/librashader-runtime-gl/Cargo.toml @@ -25,3 +25,6 @@ thiserror = "1.0.37" [dev-dependencies] glfw = "0.47.0" + +[package.metadata.docs.rs] +targets = ["x86_64-pc-windows-msvc", "x86_64-unknown-linux-gnu"] \ No newline at end of file diff --git a/librashader-runtime-vk/Cargo.toml b/librashader-runtime-vk/Cargo.toml index 1ea4427..9437f1b 100644 --- a/librashader-runtime-vk/Cargo.toml +++ b/librashader-runtime-vk/Cargo.toml @@ -32,3 +32,5 @@ winit = "0.27.5" raw-window-handle = "0.5" ash-window = "0.12.0" +[package.metadata.docs.rs] +targets = ["x86_64-pc-windows-msvc", "x86_64-unknown-linux-gnu"] \ No newline at end of file diff --git a/librashader/Cargo.toml b/librashader/Cargo.toml index 682e36c..f2cdd2d 100644 --- a/librashader/Cargo.toml +++ b/librashader/Cargo.toml @@ -22,7 +22,6 @@ librashader-runtime-d3d11 = { path = "../librashader-runtime-d3d11", version = librashader-runtime-gl = { path = "../librashader-runtime-gl", version = "0.1.0-beta.2", optional = true } librashader-runtime-vk = { path = "../librashader-runtime-vk", version = "0.1.0-beta.2", optional = true } - ash = { version = "0.37.1+1.3.235", optional = true } [target.'cfg(windows)'.dependencies.windows] @@ -41,3 +40,6 @@ runtime = [] reflect = [] preprocess = [] presets = [] + +[package.metadata.docs.rs] +targets = ["x86_64-pc-windows-msvc", "x86_64-unknown-linux-gnu"] \ No newline at end of file