mirror of
https://anongit.gentoo.org/git/repo/gentoo.git
synced 2025-07-22 06:57:59 +02:00
Closes: https://bugs.gentoo.org/953010 Closes: https://bugs.gentoo.org/953027 Signed-off-by: idealseal <realidealseal@protonmail.com> Closes: https://github.com/gentoo/gentoo/pull/41465 Signed-off-by: Sam James <sam@gentoo.org>
48 lines
1.7 KiB
Diff
48 lines
1.7 KiB
Diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index 496226e89..69bdf037d 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -52,18 +52,7 @@ function(CREATE_TARGET target)
|
|
${target} ALL
|
|
COMMAND
|
|
"${CMAKE_COMMAND}" -E
|
|
- env ${VARS_FOR_CARGO}
|
|
- ${Rust_CARGO}
|
|
- build --bin ${target}
|
|
- $<$<CONFIG:Release>:--release>
|
|
- $<$<CONFIG:RelWithDebInfo>:--profile=release-with-debug>
|
|
- --target ${Rust_CARGO_TARGET}
|
|
- --no-default-features
|
|
- ${CARGO_FLAGS}
|
|
- ${FEATURES_ARG}
|
|
- &&
|
|
- "${CMAKE_COMMAND}" -E
|
|
- copy "${rust_target_dir}/${rust_profile}/${target}" "${CMAKE_CURRENT_BINARY_DIR}"
|
|
+ copy "${FISH_RUST_BUILD_DIR}/${rust_profile}/${target}" "${CMAKE_CURRENT_BINARY_DIR}"
|
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
|
USES_TERMINAL
|
|
)
|
|
diff --git a/cmake/Rust.cmake b/cmake/Rust.cmake
|
|
index 40887be45..fa0f7ab6f 100644
|
|
--- a/cmake/Rust.cmake
|
|
+++ b/cmake/Rust.cmake
|
|
@@ -5,7 +5,7 @@ set(Rust_RESOLVE_RUSTUP_TOOLCHAINS Off)
|
|
include(FindRust)
|
|
find_package(Rust REQUIRED)
|
|
|
|
-set(FISH_RUST_BUILD_DIR "${CMAKE_BINARY_DIR}/cargo/build")
|
|
+set(FISH_RUST_BUILD_DIR "${CMAKE_SOURCE_DIR}/target")
|
|
|
|
if(DEFINED ASAN)
|
|
list(APPEND CARGO_FLAGS "-Z" "build-std")
|
|
@@ -22,8 +22,8 @@ else()
|
|
set(rust_target_dir "${FISH_RUST_BUILD_DIR}/${Rust_CARGO_HOST_TARGET}")
|
|
endif()
|
|
|
|
-set(rust_profile $<IF:$<CONFIG:Debug>,debug,$<IF:$<CONFIG:RelWithDebInfo>,release-with-debug,release>>)
|
|
-set(rust_debugflags "$<$<CONFIG:Debug>:-g>$<$<CONFIG:RelWithDebInfo>:-g>")
|
|
+set(rust_profile $<IF:$<CONFIG:Debug>,debug,release>)
|
|
+set(rust_debugflags "$<$<CONFIG:Debug>:-g>")
|
|
|
|
|
|
# Temporary hack to propogate CMake flags/options to build.rs. We need to get CMake to evaluate the
|