blob: 8261a35889813cd19bc487c726351b6fbcbe55ff (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 15f32f8466..11c11e292c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -45,18 +45,7 @@
${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
- --features=${FISH_CARGO_FEATURES}
- ${CARGO_FLAGS}
- &&
- "${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 00ddf90559..a8ae3028d0 100644
--- a/cmake/Rust.cmake
+++ b/cmake/Rust.cmake
@@ -1,7 +1,7 @@
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")
@@ -18,8 +18,8 @@
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>")
option(WITH_GETTEXT "Build with gettext localization support. Requires `msgfmt` to work." ON)
# Enable gettext feature unless explicitly disabled.
|