Merge topic 'vs-ifx'

eae0a053f5 VS: Default Intel Fortran projects to ifx in VS 18 and above

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11197
This commit is contained in:
Brad King
2025-09-17 14:11:17 +00:00
committed by Kitware Robot
4 changed files with 22 additions and 5 deletions

View File

@@ -9,4 +9,11 @@ Fortran compiler to be used by Visual Studio projects.
that have the required Visual Studio Integration feature installed. The
compiler may be specified by a field in :variable:`CMAKE_GENERATOR_TOOLSET` of
the form ``fortran=...``. CMake provides the selected Fortran compiler in this
variable. The value may be empty if the field was not specified.
variable.
If the field was not specified, the default depends on the generator:
* On :generator:`Visual Studio 18 2026` and above, the default is ``ifx``.
* On older :ref:`Visual Studio Generators`, the default is empty, which the
Intel Visual Studio Integration interprets as equivalent to ``ifort``.

View File

@@ -797,6 +797,15 @@ std::string const& cmGlobalVisualStudio10Generator::
return this->GeneratorToolsetCudaVSIntegrationSubdir;
}
cm::optional<std::string>
cmGlobalVisualStudio10Generator::GetPlatformToolsetFortran() const
{
if (this->GeneratorToolsetFortran) {
return this->GeneratorToolsetFortran;
}
return this->DefaultToolsetFortran;
}
cmGlobalVisualStudio10Generator::AuxToolset
cmGlobalVisualStudio10Generator::FindAuxToolset(std::string&,
std::string&) const

View File

@@ -94,10 +94,7 @@ public:
std::string const& GetPlatformToolsetCudaVSIntegrationSubdirString() const;
/** The fortran toolset name. */
cm::optional<std::string> GetPlatformToolsetFortran() const override
{
return this->GeneratorToolsetFortran;
}
cm::optional<std::string> GetPlatformToolsetFortran() const override;
/** Return whether we need to use No/Debug instead of false/true
for GenerateDebugInformation. */
@@ -236,6 +233,7 @@ protected:
std::string GeneratorToolsetCudaNvccSubdir;
std::string GeneratorToolsetCudaVSIntegrationSubdir;
cm::optional<std::string> GeneratorToolsetFortran;
cm::optional<std::string> DefaultToolsetFortran;
std::string DefaultPlatformToolset;
std::string DefaultPlatformToolsetHostArchitecture;
std::string DefaultAndroidToolset;

View File

@@ -513,6 +513,9 @@ cmGlobalVisualStudioVersionedGenerator::cmGlobalVisualStudioVersionedGenerator(
// Use a version installed by VS 2022 without a separate component.
this->DefaultTargetFrameworkVersion = "v4.7.2";
}
if (this->Version >= cmGlobalVisualStudioGenerator::VSVersion::VS18) {
this->DefaultToolsetFortran = "ifx";
}
}
bool cmGlobalVisualStudioVersionedGenerator::MatchesGeneratorName(