From af8771f9747041d87cfc8984613c7f803ca10e75 Mon Sep 17 00:00:00 2001 From: Eduard Voronkin Date: Thu, 25 Dec 2025 12:50:21 -0800 Subject: FASTBuild: set PlatformToolset in the generated .bff file Fixes: #27481 --- Source/cmGlobalFastbuildGenerator.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Source/cmGlobalFastbuildGenerator.cxx b/Source/cmGlobalFastbuildGenerator.cxx index 7b613c7..383a129 100644 --- a/Source/cmGlobalFastbuildGenerator.cxx +++ b/Source/cmGlobalFastbuildGenerator.cxx @@ -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); -- cgit v0.12