Skip to content

Use Ninja generator for all CMake presets#1230

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/fix-build-failure-vs-2022-2026
Draft

Use Ninja generator for all CMake presets#1230
Copilot wants to merge 3 commits intomainfrom
copilot/fix-build-failure-vs-2022-2026

Conversation

Copy link
Contributor

Copilot AI commented Feb 3, 2026

The CMake presets used inconsistent generators which caused build failures on Windows (VS 2022/2026). The gcc-base and clang-base presets used "Unix Makefiles" which fails on Windows with CMake was unable to find a build program corresponding to "Unix Makefiles". The msvc-base preset used "Visual Studio 17 2022" which is Windows-specific.

Changes

  • Changed generator from "Unix Makefiles" to "Ninja" in gcc-base and clang-base presets
  • Changed generator from "Visual Studio 17 2022" to "Ninja" in msvc-base preset
  • Removed Visual Studio-specific toolset and architecture fields from msvc-base preset
  • All presets now use the cross-platform Ninja generator for consistency
 {
     "name": "msvc-base",
     "inherits": "base",
     "hidden": true,
-    "generator": "Visual Studio 17 2022",
+    "generator": "Ninja",
     "condition": {
         "type": "equals",
         "lhs": "${hostSystemName}",
         "rhs": "Windows"
     },
-    "toolset": "host=x64",
-    "architecture": "x64",
     "cacheVariables": {
         "CMAKE_CXX_COMPILER": "cl"
     }
 }

This ensures consistent, fast builds across all platforms and compilers.

Original prompt

This section details on the original issue you should resolve

<issue_title>Since c31617f build fails on VS 2022 and VS 2026</issue_title>
<issue_description>Describe the bug
The build of the test fails.

1> CMake generation started for configuration: 'clang-14-debug-clang-14-debug'.
1> Environment settings:
1>     CXXFLAGS=--target=amd64-pc-windows-msvc -fdiagnostics-absolute-paths
1>     CFLAGS=--target=amd64-pc-windows-msvc -fdiagnostics-absolute-paths
1>     CommandPromptType=Native
1>     DevEnvDir=C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\
1>     ExtensionSdkDir=C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs
1>     EXTERNAL_INCLUDE=C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.44.35207\include;C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.44.35207\ATLMFC\include;C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\VS\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\ucrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\um;C:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\shared;C:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\winrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\cppwinrt
1>     Framework40Version=v4.0
1>     FrameworkDir=C:\Windows\Microsoft.NET\Framework64\
1>     FrameworkDir64=C:\Windows\Microsoft.NET\Framework64\
1>     FrameworkVersion=v4.0.30319
1>     FrameworkVersion64=v4.0.30319
1>     IFCPATH=C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.44.35207\ifc\x64
1>     INCLUDE=C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.44.35207\include;C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.44.35207\ATLMFC\include;C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\VS\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\ucrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\um;C:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\shared;C:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\winrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\cppwinrt
1>     LIB=C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.44.35207\ATLMFC\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.44.35207\lib\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.26100.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\\lib\10.0.26100.0\\um\x64
1>     LIBPATH=C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.44.35207\ATLMFC\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.44.35207\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.44.35207\lib\x86\store\references;C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.26100.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.26100.0;C:\Windows\Microsoft.NET\Framework64\v4.0.30319
1>     Path=C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.44.35207\bin\HostX64\x64;C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\VC\VCPackages;C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\bin\Roslyn;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\\x64;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\;C:\Program Files\Microsoft Visual Studio\2022\Professional\Team Tools\DiagnosticsHub\Collector;C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\\x64;C:\Program Files (x86)\Windows Kits\10\bin\\x64;C:\Program Files\Microsoft Visual Studio\2022\Professional\\MSBuild\Current\Bin\amd64;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\;C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\Tools\;C:\Program Files\Eclipse Adoptium\jre-8.0.472.8-hotspot\bin;C:\Program Files\Python314\Scripts\;C:\Program Files\Python314\;C:\Program Files\Python313\Scripts\;C:\Program Files\Python313\;C:\Program Files\Python312\Scripts\;C:\Program Files\Python312\;C:\Perl64\site\bin;C:\Perl64\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\AVMProgramme\oracle\oledb\bin;c:\AVMProgramme\oracle\ocl;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\dotnet\;C:\Program Files\WindowsPowerShell\Scripts\HP.ClientScriptLibrary;C:\Program Files\Azure Data Studio\bin;C:\Program Files\Git LFS;C:\Program Files\WinMerge;C:\Program Fi...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes microsoft/GSL#1229

<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for you](https://github.com/microsoft/GSL/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: carsonRadtke <10507970+carsonRadtke@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix build failure on VS 2022 and VS 2026 Use Ninja generator for gcc and clang presets Feb 3, 2026
Copilot AI requested a review from carsonRadtke February 3, 2026 17:46
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot "Ninja" here too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was already changed to "Ninja" in commit 06dd56d (the previous commit in this PR).

Co-authored-by: carsonRadtke <10507970+carsonRadtke@users.noreply.github.com>
Copilot AI changed the title Use Ninja generator for gcc and clang presets Use Ninja generator for all CMake presets Feb 4, 2026
Copilot AI requested a review from carsonRadtke February 4, 2026 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants