summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.cargo/config.toml5
-rw-r--r--Cargo.lock4
-rw-r--r--Cargo.toml2
-rw-r--r--xtask/Cargo.toml6
-rw-r--r--xtask/src/main.rs24
5 files changed, 40 insertions, 1 deletions
diff --git a/.cargo/config.toml b/.cargo/config.toml
index af130b7..eed713a 100644
--- a/.cargo/config.toml
+++ b/.cargo/config.toml
@@ -1,3 +1,8 @@
+[alias]
+fcheck = "run -p xtask -- execute cargo +nightly check --config .cargo/config-nightly-fast-compile.toml"
+fbuild = "run -p xtask -- execute cargo +nightly build --config .cargo/config-nightly-fast-compile.toml"
+frun = "run -p xtask -- execute cargo +nightly run --config .cargo/config-nightly-fast-compile.toml"
+
[env]
SLANG_USE_PREBUILT = "1"
diff --git a/Cargo.lock b/Cargo.lock
index 6b2d0f2..7dc3324 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3148,6 +3148,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c5b940ebc25896e71dd073bad2dbaa2abfe97b0a391415e22ad1326d9c54e3c4"
[[package]]
+name = "xtask"
+version = "0.1.0"
+
+[[package]]
name = "zerocopy"
version = "0.8.42"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/Cargo.toml b/Cargo.toml
index 4eaf692..55fe089 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2021"
[workspace]
-members = ["engine*", "util-macros", "opengl-bindings"]
+members = ["engine*", "util-macros", "opengl-bindings", "xtask"]
[workspace.dependencies]
engine = { path = "engine" }
diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml
new file mode 100644
index 0000000..337bfe3
--- /dev/null
+++ b/xtask/Cargo.toml
@@ -0,0 +1,6 @@
+[package]
+name = "xtask"
+version = "0.1.0"
+edition = "2021"
+
+[dependencies]
diff --git a/xtask/src/main.rs b/xtask/src/main.rs
new file mode 100644
index 0000000..e955925
--- /dev/null
+++ b/xtask/src/main.rs
@@ -0,0 +1,24 @@
+use std::process::Command;
+
+fn main()
+{
+ let mut args = std::env::args();
+
+ let Some(task) = args.nth(1) else {
+ println!("Error: No task is specified");
+ return;
+ };
+
+ if task == "execute" {
+ let Some(program) = args.next() else {
+ println!("Error: No program is specified");
+ return;
+ };
+
+ if let Err(err) = Command::new(program).args(args).status() {
+ println!("Error: Failed to execute command: {err}");
+ }
+ } else {
+ println!("Error: Unknown task '{task}'");
+ }
+}