From f75912d20543ec3eec5f90af8fb9f5d484a1f5b5 Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Sat, 28 Dec 2024 16:03:40 +0100 Subject: [PATCH] Create release-with-debug cargo profile, hook it up with cmake Fixes #10959 (cherry picked from commit 66b80041cc84d067662af9f07cdbca4d22379bab) --- CMakeLists.txt | 2 +- Cargo.toml | 4 ++++ cmake/Rust.cmake | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 310108df9..496226e89 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,7 +56,7 @@ function(CREATE_TARGET target) ${Rust_CARGO} build --bin ${target} $<$:--release> - $<$:--release> + $<$:--profile=release-with-debug> --target ${Rust_CARGO_TARGET} --no-default-features ${CARGO_FLAGS} diff --git a/Cargo.toml b/Cargo.toml index 28693d3aa..69fc9bd02 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,10 @@ edition = "2021" overflow-checks = true lto = true +[profile.release-with-debug] +inherits = "release" +debug = true + [package] name = "fish" version = "4.0.0-beta.1" diff --git a/cmake/Rust.cmake b/cmake/Rust.cmake index 7a7949663..82102fc3f 100644 --- a/cmake/Rust.cmake +++ b/cmake/Rust.cmake @@ -22,7 +22,7 @@ else() set(rust_target_dir "${FISH_RUST_BUILD_DIR}/${Rust_CARGO_HOST_TARGET}") endif() -set(rust_profile $,debug,release>) +set(rust_profile $,debug,$,release-with-debug,release>>) set(rust_debugflags "$<$:-g>$<$:-g>")