This commit is contained in:
sxyazi 2025-02-04 13:49:14 +08:00
parent 566847359e
commit dcb4faafbd
No known key found for this signature in database
3 changed files with 21 additions and 3 deletions

View file

@ -96,7 +96,7 @@ jobs:
uses: mozilla-actions/sccache-action@v0.0.6
- name: Build
run: cargo build --release --locked --target ${{ matrix.target }}
run: cargo build --profile release-windows --locked --target ${{ matrix.target }}
- name: Pack artifact
env:

View file

@ -9,8 +9,10 @@ lto = true
panic = "abort"
strip = true
[target.'cfg(windows)'.profile.release]
panic = "unwind"
[profile.release-windows]
codegen-units = 1
lto = true
strip = true
[workspace.dependencies]
ansi-to-tui = "7.0.0"

16
yazi-fm/build.rs Normal file
View file

@ -0,0 +1,16 @@
use std::{env, error::Error};
fn main() -> Result<(), Box<dyn Error>> {
if env::var_os("CARGO_CFG_TARGET_FAMILY").unwrap() != "windows" {
return Ok(());
}
if env::var_os("CARGO_CFG_PANIC").unwrap() == "unwind" {
return Ok(());
}
panic!(
"Unwinding must be enabled for Windows. Please use `cargo build --profile release-windows --locked` instead to build Yazi."
);
Ok(())
}