From 01a832027dad8c104704f4ff868d8afdb7a726ce Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Sat, 22 Feb 2025 15:22:55 -0800 Subject: [PATCH] build(cargo): add custom build profiles --- Cargo.toml | 13 +++++++++++++ justfile | 13 +++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ecad870c..1f6662c5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -71,3 +71,16 @@ features = [ "Media", "Media_Control" ] + +[profile.dev-jeezy] +inherits = "dev" +debug = false +opt-level = 1 + +[profile.dev-jeezy.package."*"] +opt-level = 3 + +[profile.release-jeezy] +inherits = "release" +incremental = true +codegen-units = 256 \ No newline at end of file diff --git a/justfile b/justfile index 6398c3ca..2d085958 100644 --- a/justfile +++ b/justfile @@ -28,13 +28,22 @@ build-targets *targets: "{{ targets }}" -split ' ' | ForEach-Object { just build-target $_ } build-target target: - cargo +stable build --release --package {{ target }} --locked + cargo +stable build --package {{ target }} --locked --profile release-jeezy build: just build-targets komorebic komorebic-no-console komorebi komorebi-bar komorebi-gui +copy-target target: + cp .\target\release-jeezy\{{ target }}.exe $Env:USERPROFILE\.cargo\bin + +copy-targets *targets: + "{{ targets }}" -split ' ' | ForEach-Object { just copy-target $_ } + +copy: + just copy-targets komorebic komorebic-no-console komorebi komorebi-bar komorebi-gui + run target: - cargo +stable run --bin {{ target }} --locked + cargo +stable run --bin {{ target }} --locked --profile dev-jeezy warn target $RUST_LOG="warn": just run {{ target }}