diff --git a/CMakeLists.txt b/CMakeLists.txt index 15f32f846..d161def83 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,24 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}) # This defines the FBVF variable. include(Version) +# Set up the docs. +include(cmake/Docs.cmake) + +# Tell Cargo where our build directory is so it can find Cargo.toml. +set(VARS_FOR_CARGO + "FISH_CMAKE_BINARY_DIR=${CMAKE_BINARY_DIR}" + "PREFIX=${CMAKE_INSTALL_PREFIX}" + "DOCDIR=${CMAKE_INSTALL_FULL_DOCDIR}" + "DATADIR=${CMAKE_INSTALL_FULL_DATADIR}" + "SYSCONFDIR=${CMAKE_INSTALL_FULL_SYSCONFDIR}" + "BINDIR=${CMAKE_INSTALL_FULL_BINDIR}" + "CARGO_TARGET_DIR=${FISH_RUST_BUILD_DIR}" + "CARGO_BUILD_RUSTC=${Rust_COMPILER}" + "${FISH_PCRE2_BUILDFLAG}" + "RUSTFLAGS=$ENV{RUSTFLAGS} ${rust_debugflags}" + "FISH_SPHINX=${SPHINX_EXECUTABLE}" +) + # Let fish pick up when we're running out of the build directory without installing get_filename_component(REAL_CMAKE_BINARY_DIR "${CMAKE_BINARY_DIR}" REALPATH) get_filename_component(REAL_CMAKE_SOURCE_DIR "${CMAKE_SOURCE_DIR}" REALPATH) @@ -71,9 +89,6 @@ create_target(fish_indent) # Define fish_key_reader. create_target(fish_key_reader) -# Set up the docs. -include(cmake/Docs.cmake) - # Set up tests. include(cmake/Tests.cmake) diff --git a/cmake/Rust.cmake b/cmake/Rust.cmake index b19451399..1de0da580 100644 --- a/cmake/Rust.cmake +++ b/cmake/Rust.cmake @@ -30,17 +30,3 @@ if(NOT DEFINED WITH_GETTEXT OR "${WITH_GETTEXT}") endif() list(JOIN FISH_CARGO_FEATURES_LIST , FISH_CARGO_FEATURES) - -# Tell Cargo where our build directory is so it can find Cargo.toml. -set(VARS_FOR_CARGO - "FISH_CMAKE_BINARY_DIR=${CMAKE_BINARY_DIR}" - "PREFIX=${CMAKE_INSTALL_PREFIX}" - "DOCDIR=${CMAKE_INSTALL_FULL_DOCDIR}" - "DATADIR=${CMAKE_INSTALL_FULL_DATADIR}" - "SYSCONFDIR=${CMAKE_INSTALL_FULL_SYSCONFDIR}" - "BINDIR=${CMAKE_INSTALL_FULL_BINDIR}" - "CARGO_TARGET_DIR=${FISH_RUST_BUILD_DIR}" - "CARGO_BUILD_RUSTC=${Rust_COMPILER}" - "${FISH_PCRE2_BUILDFLAG}" - "RUSTFLAGS=$ENV{RUSTFLAGS} ${rust_debugflags}" -) diff --git a/crates/build-man-pages/build.rs b/crates/build-man-pages/build.rs index 011c73355..b444c2067 100644 --- a/crates/build-man-pages/build.rs +++ b/crates/build-man-pages/build.rs @@ -54,7 +54,7 @@ fn build_man(man_dir: &Path) { // - if we skipped the docs with sphinx not installed, installing it would not then build the docs. // That means you need to explicitly set $FISH_BUILD_DOCS=0 (`FISH_BUILD_DOCS=0 cargo install --path .`), // which is unfortunate - but the docs are pretty important because they're also used for --help. - let sphinx_build = match Command::new("sphinx-build") + let sphinx_build = match Command::new(option_env!("FISH_SPHINX").unwrap_or("sphinx-build")) .args(args) .stdout(Stdio::piped()) .stderr(Stdio::piped())