mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-22 10:11:13 -03:00
Commit 0709e4be8b (Use standalone code paths by default, 2025-10-26)
made CMake builds enable the embed-data feature. This means that
crates/build-man-pages/build.rs will run "sphinx-build" to create
man pages for embedding, now also for CMake builds.
Let's use the sphinx-build found by CMake at configuration-time.
This makes VARS_FOR_CARGO depend on cmake/Docs.cmake, so adjust the
order accordingly.
33 lines
1.1 KiB
CMake
33 lines
1.1 KiB
CMake
include(FindRust)
|
|
find_package(Rust REQUIRED)
|
|
|
|
set(FISH_RUST_BUILD_DIR "${CMAKE_BINARY_DIR}/cargo/build")
|
|
|
|
list(APPEND FISH_CARGO_FEATURES_LIST "embed-data")
|
|
|
|
if(DEFINED ASAN)
|
|
list(APPEND CARGO_FLAGS "-Z" "build-std")
|
|
list(APPEND FISH_CARGO_FEATURES_LIST "asan")
|
|
endif()
|
|
if(DEFINED TSAN)
|
|
list(APPEND CARGO_FLAGS "-Z" "build-std")
|
|
list(APPEND FISH_CARGO_FEATURES_LIST "tsan")
|
|
endif()
|
|
|
|
if (Rust_CARGO_TARGET)
|
|
set(rust_target_dir "${FISH_RUST_BUILD_DIR}/${Rust_CARGO_TARGET}")
|
|
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>")
|
|
|
|
option(WITH_GETTEXT "Build with gettext localization support. Requires `msgfmt` to work." ON)
|
|
# Enable gettext feature unless explicitly disabled.
|
|
if(NOT DEFINED WITH_GETTEXT OR "${WITH_GETTEXT}")
|
|
list(APPEND FISH_CARGO_FEATURES_LIST "localize-messages")
|
|
endif()
|
|
|
|
list(JOIN FISH_CARGO_FEATURES_LIST , FISH_CARGO_FEATURES)
|