diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5201d930..c5f65093 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -246,7 +246,7 @@ jobs: toolchain: ${{matrix.rust}} targets: ${{matrix.arch}}-apple-darwin - name: Configure - run: cmake -S. -Bbuild -G "${{ matrix.generator }}" "-DRust_TOOLCHAIN=${{steps.install_rust.outputs.name}}" --preset "${{ matrix.arch }}-apple-darwin-${{ matrix.compiler }}" + run: cmake -S. -Bbuild --log-level=DEBUG -G "${{ matrix.generator }}" "-DRust_TOOLCHAIN=${{steps.install_rust.outputs.name}}" --preset "${{ matrix.arch }}-apple-darwin-${{ matrix.compiler }}" - name: Run Tests working-directory: build run: ctest --output-on-failure --build-config Debug -j 3 diff --git a/cmake/FindRust.cmake b/cmake/FindRust.cmake index 37adb8ee..10b8b194 100644 --- a/cmake/FindRust.cmake +++ b/cmake/FindRust.cmake @@ -487,16 +487,15 @@ if (Rust_RESOLVE_RUSTUP_TOOLCHAINS) rustc HINTS "${_RUST_TOOLCHAIN_PATH}/bin" NO_DEFAULT_PATH) -elseif (Rust_RUSTUP) - get_filename_component(_RUST_TOOLCHAIN_PATH "${Rust_RUSTUP}" DIRECTORY) - get_filename_component(_RUST_TOOLCHAIN_PATH "${_RUST_TOOLCHAIN_PATH}" DIRECTORY) - find_program( - Rust_COMPILER_CACHED - rustc - HINTS "${_RUST_TOOLCHAIN_PATH}/bin" - NO_DEFAULT_PATH) else() - find_program(Rust_COMPILER_CACHED rustc) + message(DEBUG "Rust_RESOLVE_RUSTUP_TOOLCHAINS=OFF and Rust_RUSTUP=${Rust_RUSTUP}") + if(Rust_RUSTUP) + get_filename_component(_RUSTUP_DIR "${Rust_RUSTUP}" DIRECTORY) + find_program(Rust_COMPILER_CACHED rustc HINTS "${_RUSTUP_DIR}") + else() + find_program(Rust_COMPILER_CACHED rustc) + endif() + message(DEBUG "find_program rustc: ${Rust_COMPILER_CACHED}") if (EXISTS "${Rust_COMPILER_CACHED}") # rustc is expected to be at `/bin/rustc`. get_filename_component(_RUST_TOOLCHAIN_PATH "${Rust_COMPILER_CACHED}" DIRECTORY)