add zephyr ECS subcrate
This commit is contained in:
parent
506755d06f
commit
e0b84814f7
5 changed files with 30 additions and 5 deletions
12
Cargo.toml
12
Cargo.toml
|
@ -1,8 +1,6 @@
|
|||
[workspace]
|
||||
resolver = "2"
|
||||
members = [
|
||||
"engine"
|
||||
]
|
||||
members = ["engine", "subcrates/zephyr"]
|
||||
|
||||
[profile.dev]
|
||||
rpath = false
|
||||
|
@ -17,7 +15,7 @@ codegen-units = 512
|
|||
strip = "symbols"
|
||||
debug-assertions = false
|
||||
|
||||
[profile.dev.package."*"]
|
||||
[profile.dev.package."*"]
|
||||
opt-level = 0
|
||||
debug = false
|
||||
overflow-checks = false
|
||||
|
@ -31,4 +29,8 @@ opt-level = 0
|
|||
debug = false
|
||||
overflow-checks = false
|
||||
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"] }
|
||||
wgpu = "23.0.1"
|
||||
winit = "0.30.5"
|
||||
zephyr.workspace = true
|
|
@ -15,6 +15,8 @@ struct Cli {
|
|||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
let t = zephyr::add(0, 2);
|
||||
println!("{}", t);
|
||||
let cli = Cli::parse();
|
||||
|
||||
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