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 c8adaf525..d29494f40 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,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>")