diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 8e124291..017e7ffd 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -43,11 +43,11 @@ jobs: path: | ~/.cargo/registry ~/.cargo/git - target/debug + target/release key: cargo-${{ matrix.platform }}-${{ hashFiles('**/Cargo.lock') }} - name: Run cargo build run: | - cargo build --locked + cargo build --release --locked - name: Run cargo test run: | cargo test --locked @@ -56,8 +56,8 @@ jobs: with: name: MFEKglif-${{ matrix.platform }} path: | - target/debug/MFEKglif - target/debug/MFEKglif.exe + target/release/MFEKglif + target/release/MFEKglif.exe rustfmt: strategy: diff --git a/Cargo.toml b/Cargo.toml index 73eaa105..7b9f7d43 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "MFEKglif" -version = "1.0.1" +version = "1.1.0-beta1" authors = ["Fredrick Brennan ", "Matthew Blanchard "] # + MFEK authors edition = "2021" @@ -45,7 +45,6 @@ enum-unitary = "0.4" itertools = "0.10" # Display backtraces -backtrace = "0.3" colored = "2.0" arboard = { version = "2.0" } @@ -58,6 +57,9 @@ env_logger = "0.9" # Gives us derive(Display) derive_more = "0.99" +# Gives us derivative(Debug) +derivative = "2.2" + # File dialog nfd = { git = "https://github.com/raphlinus/nfd-rs", rev = "5e09b79bf511e3a91ae8cefdb96e9734fa4a79c2" } @@ -109,14 +111,18 @@ plist = "1.3" # we use this for affine matrices in some of our data types kurbo = {version = "0.8", features = ["serde"]} -[features] -default = ["sdl2/bundled", "sdl2/static-link"] +[target.'cfg(debug)'.dependencies] +backtrace = "0.3" # See src/util/mod.rs::set_codepage_utf8 [target.'cfg(windows)'.dependencies] winapi = "0.3" +[features] +default = ["sdl2/bundled", "sdl2/static-link"] + [profile.release] -opt-level = 'z' -lto = true +opt-level = 3 +#lto = true codegen-units = 1 +panic = "abort" diff --git a/Xargo.toml b/Xargo.toml new file mode 100644 index 00000000..98dd14a1 --- /dev/null +++ b/Xargo.toml @@ -0,0 +1,4 @@ +[target.x86_64-unknown-linux-gnu.dependencies] +core = {} +alloc = {} +std = {} diff --git a/build.rs b/build.rs new file mode 100644 index 00000000..eace9a62 --- /dev/null +++ b/build.rs @@ -0,0 +1,6 @@ +fn main() { + let profile = std::env::var("PROFILE").unwrap(); + if profile == "dev" { + println!("cargo:rustc-env=debug"); + } +}