Skip to content

Commit 096d3bc

Browse files
authored
Publish vulkano-macros (#2175)
* Publish vulkano-macros * Document `vulkano-macros` * Make macros dependency optional * Document `macros` feature * Fix outdated docs * Derp
1 parent 1f31e85 commit 096d3bc

File tree

13 files changed

+45
-21
lines changed

13 files changed

+45
-21
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
members = [
33
"examples",
44
"vulkano",
5+
"vulkano-macros",
56
"vulkano-shaders",
6-
"vulkano-win",
77
"vulkano-util",
8+
"vulkano-win",
89
]
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22
name = "vulkano-macros"
33
version = "0.33.0"
44
edition = "2021"
5-
authors = ["Pierre Krieger <pierre.krieger1708@gmail.com>", "The vulkano contributors"]
5+
authors = [
6+
"Pierre Krieger <pierre.krieger1708@gmail.com>",
7+
"The vulkano contributors",
8+
]
69
repository = "https://github.com/vulkano-rs/vulkano"
710
description = "Macros used by Vulkano"
811
license = "MIT/Apache-2.0"
912
documentation = "https://docs.rs/vulkano"
1013
homepage = "https://vulkano.rs"
11-
publish = false
14+
publish = true
1215

1316
[lib]
1417
proc-macro = true
@@ -20,4 +23,4 @@ proc-macro2 = "1.0"
2023
proc-macro-crate = "1.2"
2124

2225
[dev-dependencies]
23-
vulkano = { path = ".." }
26+
vulkano = { path = "../vulkano" }
File renamed without changes.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,20 @@
77
// notice may not be copied, modified, or distributed except
88
// according to those terms.
99

10+
//! Macros for [`vulkano`].
11+
//!
12+
//! [`vulkano`]: https://crates.io/crates/vulkano
13+
1014
use proc_macro::TokenStream;
1115
use proc_macro_crate::{crate_name, FoundCrate};
1216
use syn::{parse_macro_input, DeriveInput, Error};
1317

1418
mod derive_buffer_contents;
1519
mod derive_vertex;
1620

21+
/// Derives the [`Vertex`] trait.
22+
///
23+
/// [`Vertex`]: https://docs.rs/vulkano/latest/vulkano/pipeline/graphics/vertex_input/trait.Vertex.html
1724
#[proc_macro_derive(Vertex, attributes(name, format))]
1825
pub fn derive_vertex(input: TokenStream) -> TokenStream {
1926
let ast = parse_macro_input!(input as DeriveInput);
@@ -23,6 +30,9 @@ pub fn derive_vertex(input: TokenStream) -> TokenStream {
2330
.into()
2431
}
2532

33+
/// Derives the [`BufferContents`] trait.
34+
///
35+
/// [`BufferContents`]: https://docs.rs/vulkano/latest/vulkano/buffer/trait.BufferContents.html
2636
#[proc_macro_derive(BufferContents)]
2737
pub fn derive_buffer_contents(input: TokenStream) -> TokenStream {
2838
let ast = parse_macro_input!(input as DeriveInput);

vulkano-shaders/Cargo.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
name = "vulkano-shaders"
33
version = "0.33.0"
44
edition = "2021"
5-
authors = ["Pierre Krieger <pierre.krieger1708@gmail.com>", "The vulkano contributors"]
5+
authors = [
6+
"Pierre Krieger <pierre.krieger1708@gmail.com>",
7+
"The vulkano contributors",
8+
]
69
repository = "https://github.com/vulkano-rs/vulkano"
710
description = "Shaders rust code generation macro"
811
license = "MIT/Apache-2.0"
@@ -21,7 +24,7 @@ proc-macro2 = "1.0"
2124
quote = "1.0"
2225
shaderc = "0.8"
2326
syn = { version = "1.0", features = ["full", "extra-traits"] }
24-
vulkano = { version = "0.33.0", path = "../vulkano" }
27+
vulkano = { version = "0.33.0", path = "../vulkano", default-features = false }
2528

2629
[features]
2730
shaderc-build-from-source = ["shaderc/build-from-source"]

vulkano-util/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ categories = ["rendering::graphics-api"]
1313

1414
[dependencies]
1515
ahash = "0.8"
16-
vulkano = { version = "0.33.0", path = "../vulkano" }
16+
vulkano = { version = "0.33.0", path = "../vulkano", default-features = false }
1717
vulkano-win = { version = "0.33.0", path = "../vulkano-win" }
1818
winit = { version = "0.28" }

vulkano-win/Cargo.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
name = "vulkano-win"
33
version = "0.33.0"
44
edition = "2021"
5-
authors = ["Pierre Krieger <pierre.krieger1708@gmail.com>", "The vulkano contributors"]
5+
authors = [
6+
"Pierre Krieger <pierre.krieger1708@gmail.com>",
7+
"The vulkano contributors",
8+
]
69
repository = "https://github.com/vulkano-rs/vulkano"
710
description = "Link between vulkano and winit"
811
license = "MIT/Apache-2.0"
@@ -20,7 +23,7 @@ winit_ = ["dep:winit", "dep:objc", "dep:core-graphics-types"]
2023

2124
[dependencies]
2225
raw-window-handle = { version = "0.5", optional = true }
23-
vulkano = { version = "0.33.0", path = "../vulkano" }
26+
vulkano = { version = "0.33.0", path = "../vulkano", default-features = false }
2427
winit = { version = "0.28", optional = true }
2528

2629
[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies]

vulkano-win/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//! # Cargo features
22
//!
3-
//! | Feature | Description |
4-
//! |----------------------|----------------------------------------------------------------------------|
5-
//! | `raw_window_handle_` | Include support for the [`raw_window_handle`] library. Enabled by default. |
6-
//! | `winit_` | Include support for the [`winit`] library. Enabled by default. |
3+
//! | Feature | Description |
4+
//! |----------------------|---------------------------------------------------------------------------|
5+
//! | `raw_window_handle` | Include support for the [`raw_window_handle`] library. Enabled by default. |
6+
//! | `winit` | Include support for the [`winit`] library. Enabled by default. |
77
//!
88
//! [`raw_window_handle`]: https://crates.io/crates/raw_window_handle
99
//! [`winit`]: https://crates.io/crates/winit

vulkano/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ parking_lot = { version = "0.12", features = ["send_guard"] }
3030
serde = { version = "1.0", optional = true }
3131
smallvec = "1.8"
3232
thread_local = "1.1"
33-
vulkano-macros = { path = "macros", version = "0.33.0" }
33+
vulkano-macros = { path = "../vulkano-macros", version = "0.33.0", optional = true }
3434

3535
[target.'cfg(target_os = "ios")'.dependencies]
3636
objc = "0.2.5"
@@ -53,4 +53,6 @@ cgmath = "0.18"
5353
nalgebra = "0.32"
5454

5555
[features]
56+
default = ["macros"]
57+
macros = ["vulkano-macros"]
5658
document_unchecked = []

0 commit comments

Comments
 (0)