Skip to content

Commit ed89ce7

Browse files
Copilotfs-eire
andauthored
Add Visual Studio 2026 CMake generator support (#26802)
### Description Add "Visual Studio 18 2026" to the list of supported CMake generators in the build script, matching the CMake 3.32+ release that added VS 2026 support. **Changes:** - Added `"Visual Studio 18 2026"` to `--cmake_generator` choices in `build_args.py` - Updated fuzz testing generator validation to accept both VS 2022 and VS 2026 **Usage:** ```bash ./build.py --cmake_generator "Visual Studio 18 2026" --build_dir build ``` ### Motivation and Context CMake 3.32+ includes Visual Studio 18 2026 generator support. ONNX Runtime's build script only supported up to Visual Studio 17 2022, blocking users with VS 2026 installations. <!-- START COPILOT CODING AGENT SUFFIX --> <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > Recently, Visual Studio 2026 is released and CMake has the support for it: https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2018%202026.html > > However, ONNX Runtime's build script (build.py) does not have the support for it. currently supported cmake generators are: > > ``` > build.py --help > > ... > --cmake_generator {MinGW Makefiles,Ninja,NMake Makefiles,NMake Makefiles JOM,Unix Makefiles,Visual Studio 17 2022,Xcode} > ... > ``` > > Please make a PR to add support for the latest visual studio. </details> <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey). --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: fs-eire <7679871+fs-eire@users.noreply.github.com>
1 parent 7b5a93e commit ed89ce7

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

tools/ci_build/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ def generate_build_tree(
10271027
if not (
10281028
args.build_shared_lib
10291029
and is_windows()
1030-
and args.cmake_generator == "Visual Studio 17 2022"
1030+
and args.cmake_generator in ("Visual Studio 17 2022", "Visual Studio 18 2026")
10311031
and args.use_full_protobuf
10321032
):
10331033
raise BuildError("Fuzz test has only be tested with build shared libs option using MSVC on windows")

tools/ci_build/build_args.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ def add_cmake_build_config_args(parser: argparse.ArgumentParser) -> None:
174174
"NMake Makefiles JOM",
175175
"Unix Makefiles",
176176
"Visual Studio 17 2022",
177+
"Visual Studio 18 2026",
177178
"Xcode",
178179
],
179180
default=None, # Will be set later based on OS and WASM

0 commit comments

Comments
 (0)