rewrite: Absolute basics (#713)

rewrite: Absolute basics
This commit is contained in:
Friz64 2023-03-13 22:06:38 +01:00 committed by GitHub
parent 2212bf5e42
commit eaf140fcb0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 96 additions and 4 deletions

View file

@ -27,7 +27,7 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: check
args: -p ash --all-features
args: -p ash -p ash-rewrite --all-features
check_ash_window_msrv:
name: Check ash-window MSRV (1.64.0)
@ -40,6 +40,7 @@ jobs:
command: check
args: -p ash-window -p examples --all-features
# TODO: add a similiar job for the rewrite once that generates code
generated:
name: Generated
runs-on: ubuntu-latest
@ -119,10 +120,10 @@ jobs:
name: Clippy lint without features
with:
command: clippy
# Only test the core ash and ash-window crate, where features reside.
# Only test the core ash, ash-rewrite and ash-window crate, where features reside.
# The examples crate would otherwise enable all default features again,
# making this test moot.
args: -p ash -p ash-window --no-default-features -- -D warnings
args: -p ash -p ash-rewrite -p ash-window --no-default-features -- -D warnings
- uses: actions-rs/cargo@v1
name: Clippy lint with all features
with:

View file

@ -2,6 +2,9 @@
members = [
"examples",
"ash",
"ash-rewrite",
"ash-window",
"analysis",
"generator",
"generator-rewrite",
]

6
analysis/Cargo.toml Normal file
View file

@ -0,0 +1,6 @@
[package]
name = "analysis"
version = "2.0.0"
edition = "2021"
[dependencies]

9
analysis/src/lib.rs Normal file
View file

@ -0,0 +1,9 @@
use std::path::Path;
pub struct Analysis {}
impl Analysis {
pub fn new(_vulkan_headers_path: impl AsRef<Path>) -> Analysis {
Analysis {}
}
}

35
ash-rewrite/Cargo.toml Normal file
View file

@ -0,0 +1,35 @@
[package]
name = "ash-rewrite"
# TODO: placeholder version for the rewrite
version = "0.999.0+1.3.238"
description = "Vulkan bindings for Rust"
license = "MIT OR Apache-2.0"
repository = "https://github.com/ash-rs/ash"
readme = "../README.md"
keywords = ["gamedev", "graphics", "vulkan", "bindings"]
categories = [
"api-bindings",
"game-development",
"graphics",
"rendering::graphics-api",
]
documentation = "https://docs.rs/ash"
edition = "2021"
# TODO: reevaluate, then update in ci.yml
rust-version = "1.60.0"
[dependencies]
libloading = { version = "0.7", optional = true }
[features]
default = ["loaded", "debug"]
# Link the Vulkan loader at compile time.
linked = []
# Support searching for the Vulkan loader manually at runtime.
loaded = ["libloading"]
# Whether Vulkan structs should implement Debug.
debug = []
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

1
ash-rewrite/LICENSE-APACHE Symbolic link
View file

@ -0,0 +1 @@
../LICENSE-APACHE

1
ash-rewrite/LICENSE-MIT Symbolic link
View file

@ -0,0 +1 @@
../LICENSE-MIT

24
ash-rewrite/build.rs Normal file
View file

@ -0,0 +1,24 @@
fn main() {
#[cfg(feature = "linked")]
{
use std::env;
let target_family = env::var("CARGO_CFG_TARGET_FAMILY").unwrap();
let target_pointer_width = env::var("CARGO_CFG_TARGET_POINTER_WIDTH").unwrap();
println!("cargo:rerun-if-env-changed=VULKAN_SDK");
if let Ok(var) = env::var("VULKAN_SDK") {
let suffix = match (&*target_family, &*target_pointer_width) {
("windows", "32") => "Lib32",
("windows", "64") => "Lib",
_ => "lib",
};
println!("cargo:rustc-link-search={var}/{suffix}");
}
let lib = match &*target_family {
"windows" => "vulkan-1",
_ => "vulkan",
};
println!("cargo:rustc-link-lib={lib}");
}
}

1
ash-rewrite/src/lib.rs Normal file
View file

@ -0,0 +1 @@

View file

@ -0,0 +1,7 @@
[package]
name = "generator-rewrite"
version = "2.0.0"
edition = "2021"
[dependencies]
analysis = { path = "../analysis" }

View file

@ -0,0 +1,5 @@
use analysis::Analysis;
fn main() {
let _analysis = Analysis::new("generator/Vulkan-Headers");
}

View file

@ -1 +0,0 @@
max_width = 100