add zephyr ECS subcrate
This commit is contained in:
parent
c9ee478d96
commit
41f87a379d
5 changed files with 30 additions and 5 deletions
12
Cargo.toml
12
Cargo.toml
|
@ -1,8 +1,6 @@
|
||||||
[workspace]
|
[workspace]
|
||||||
resolver = "2"
|
resolver = "2"
|
||||||
members = [
|
members = ["engine", "subcrates/zephyr"]
|
||||||
"engine"
|
|
||||||
]
|
|
||||||
|
|
||||||
[profile.dev]
|
[profile.dev]
|
||||||
rpath = false
|
rpath = false
|
||||||
|
@ -17,7 +15,7 @@ codegen-units = 512
|
||||||
strip = "symbols"
|
strip = "symbols"
|
||||||
debug-assertions = false
|
debug-assertions = false
|
||||||
|
|
||||||
[profile.dev.package."*"]
|
[profile.dev.package."*"]
|
||||||
opt-level = 0
|
opt-level = 0
|
||||||
debug = false
|
debug = false
|
||||||
overflow-checks = false
|
overflow-checks = false
|
||||||
|
@ -31,4 +29,8 @@ opt-level = 0
|
||||||
debug = false
|
debug = false
|
||||||
overflow-checks = false
|
overflow-checks = false
|
||||||
incremental = true
|
incremental = true
|
||||||
codegen-units = 512
|
codegen-units = 512
|
||||||
|
|
||||||
|
[workspace.dependencies]
|
||||||
|
anyhow = "1.0.93"
|
||||||
|
zephyr = { path = "./subcrates/zephyr" }
|
||||||
|
|
|
@ -18,3 +18,4 @@ thiserror = "2.0.3"
|
||||||
tokio = { version = "1.41.1", features = ["macros", "rt", "rt-multi-thread"] }
|
tokio = { version = "1.41.1", features = ["macros", "rt", "rt-multi-thread"] }
|
||||||
wgpu = "23.0.1"
|
wgpu = "23.0.1"
|
||||||
winit = "0.30.5"
|
winit = "0.30.5"
|
||||||
|
zephyr.workspace = true
|
|
@ -15,6 +15,8 @@ struct Cli {
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> Result<()> {
|
async fn main() -> Result<()> {
|
||||||
|
let t = zephyr::add(0, 2);
|
||||||
|
println!("{}", t);
|
||||||
let cli = Cli::parse();
|
let cli = Cli::parse();
|
||||||
|
|
||||||
log::set_logger(&*LOGGER).unwrap();
|
log::set_logger(&*LOGGER).unwrap();
|
||||||
|
|
6
subcrates/zephyr/Cargo.toml
Normal file
6
subcrates/zephyr/Cargo.toml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
[package]
|
||||||
|
name = "zephyr"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
[dependencies]
|
14
subcrates/zephyr/src/lib.rs
Normal file
14
subcrates/zephyr/src/lib.rs
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
pub fn add(left: u64, right: u64) -> u64 {
|
||||||
|
left + right
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn it_works() {
|
||||||
|
let result = add(2, 2);
|
||||||
|
assert_eq!(result, 4);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue