Skip to content

Commit

Permalink
Add better Cargo.toml for cross-compilation and dynamic linking
Browse files Browse the repository at this point in the history
+Xargo.toml for cross compilation.
  • Loading branch information
ctrlcctrlv committed Dec 2, 2021
1 parent a62c091 commit d3df955
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
18 changes: 12 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "MFEKglif"
version = "1.0.1"
version = "1.1.0-beta1"
authors = ["Fredrick Brennan <[email protected]>", "Matthew Blanchard <[email protected]>"] # + MFEK authors
edition = "2021"

Expand Down Expand Up @@ -45,7 +45,6 @@ enum-unitary = "0.4"
itertools = "0.10"

# Display backtraces
backtrace = "0.3"
colored = "2.0"

arboard = { version = "2.0" }
Expand All @@ -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" }

Expand Down Expand Up @@ -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"
4 changes: 4 additions & 0 deletions Xargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[target.x86_64-unknown-linux-gnu.dependencies]
core = {}
alloc = {}
std = {}
6 changes: 6 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
fn main() {
let profile = std::env::var("PROFILE").unwrap();
if profile == "dev" {
println!("cargo:rustc-env=debug");
}
}

0 comments on commit d3df955

Please sign in to comment.