Tests: Do not try to detect Fortran support in Visual Studio generators

The check internally tries to open a `.vfproj` file, which can lead to
an interactive dialog.  On builds where we intend to test Fortran
support with Visual Studio we already enable the tests explicitly.

Closes: #27967
This commit is contained in:
Brad King
2026-07-20 09:41:33 -04:00
parent 1f420db71d
commit 5fb35c7e2e

View File

@@ -2,7 +2,7 @@
# file LICENSE.rst or https://cmake.org/licensing for details.
if(NOT DEFINED CMAKE_Fortran_COMPILER)
if(NOT DEFINED CMAKE_Fortran_COMPILER AND NOT CMAKE_GENERATOR MATCHES "Visual Studio")
set(_desc "Looking for a Fortran compiler")
message(STATUS ${_desc})
file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CheckFortran)