Merge topic 'fbuild_plat_toolset' into release-4.2

af8771f974 FASTBuild: set PlatformToolset in the generated .bff file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11555
This commit is contained in:
Brad King
2026-01-07 15:30:34 +00:00
committed by Kitware Robot

View File

@@ -1437,6 +1437,14 @@ void cmGlobalFastbuildGenerator::WriteTarget(FastbuildTarget const& target)
}
void cmGlobalFastbuildGenerator::WriteIDEProjects()
{
#if defined(_WIN32)
std::string platformToolset;
std::string const toolset =
this->GetSafeGlobalSetting("MSVC_TOOLSET_VERSION");
if (!toolset.empty()) {
platformToolset = cmStrCat('v', toolset);
}
#endif
for (auto const& proj : IDEProjects) {
(void)proj;
// VS
@@ -1445,6 +1453,9 @@ void cmGlobalFastbuildGenerator::WriteIDEProjects()
WriteCommand("VCXProject", Quote(VSProj.Alias));
*this->BuildFileStream << "{\n";
WriteVariable("ProjectOutput", Quote(VSProj.ProjectOutput), 1);
if (!platformToolset.empty()) {
WriteVariable("PlatformToolset", Quote(platformToolset), 1);
}
WriteIDEProjectConfig(VSProj.ProjectConfigs);
WriteVSBuildCommands();
WriteIDEProjectCommon(VSProj);