Skip to content

Commit 68c2371

Browse files
authored
hunter_setup_msvc: support Visual Studio 18 2026 toolset (#843)
Add support for `Visual Studio 18 2026` compiler suite. * CI: set_matrix: support `Visual Studio 18 2026` generator * CI: add VS-18-2026 build on beta image `windows-2025-vs2026` * test_setup_msvc: add check for 1950 -> VS 18 2026 Fixes: #842
1 parent 50aac5e commit 68c2371

4 files changed

Lines changed: 14 additions & 0 deletions

File tree

.github/workflows/ci/matrix.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
{ "example": "foo", "toolchain": "nmake-vs-17-2022-win64-cxx17", "os": "windows-2022" },
1414
{ "example": "foo", "toolchain": "vs-17-2022-win64-sdk-10-0-22000-0-cxx17", "os": "windows-2022" },
1515
{ "example": "foo", "toolchain": "vs-17-2022-win64-store-10-cxx17", "os": "windows-2022" },
16+
{ "example": "foo", "toolchain": "ninja-vs-18-2026-win64-cxx17", "os": "windows-2025-vs2026" },
1617
{ "example": "foo", "toolchain": "mingw-cxx17", "os": "windows-2022" },
1718
{ "example": "foo", "toolchain": "msys-cxx17", "os": "windows-2022" }
1819
]

.github/workflows/set_matrix.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,13 @@ def generator_and_runscript(leg: dict):
309309
)
310310
generator_str = "Visual Studio 17 2022"
311311
vcvarsall = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\Tools\\VsDevCmd.bat"
312+
elif vs_version == "18":
313+
if vs_year != "2026":
314+
raise RuntimeError(
315+
f"project: {project_name}: VS 18 expected to have year 2026"
316+
)
317+
generator_str = "Visual Studio 18 2026"
318+
vcvarsall = "C:\\Program Files\\Microsoft Visual Studio\\18\\Enterprise\\Common7\\Tools\\VsDevCmd.bat"
312319
else:
313320
raise RuntimeError(
314321
f"project: {project_name}: unhandled vs-generator: {m.group()} in toolchain: {toolchain}"

cmake/modules/hunter_setup_msvc.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ macro(hunter_setup_msvc)
6767
string(REGEX MATCH "^191[0-9]$" _vs_15_2017 "${MSVC_VERSION}")
6868
string(REGEX MATCH "^192[0-9]$" _vs_16_2019 "${MSVC_VERSION}")
6969
string(REGEX MATCH "^19[34][0-9]$" _vs_17_2022 "${MSVC_VERSION}")
70+
string(REGEX MATCH "^195[0-9]$" _vs_18_2026 "${MSVC_VERSION}")
7071

7172
if(_vs_8_2005)
7273
set(HUNTER_MSVC_VERSION "8")
@@ -95,6 +96,9 @@ macro(hunter_setup_msvc)
9596
elseif(_vs_17_2022)
9697
set(HUNTER_MSVC_VERSION "17")
9798
set(HUNTER_MSVC_YEAR "2022")
99+
elseif(_vs_18_2026)
100+
set(HUNTER_MSVC_VERSION "18")
101+
set(HUNTER_MSVC_YEAR "2026")
98102
else()
99103
hunter_internal_error("Unexpected MSVC_VERSION: '${MSVC_VERSION}'")
100104
endif()

tests/hunter_setup_msvc/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ run_check("1920" "x64" "" "x86_amd64" "x86" "amd64" "16" "2019")
114114
run_check("1930" "x64" "" "x86_amd64" "x86" "amd64" "17" "2022")
115115
run_check("1920" "x64" "x64" "amd64" "amd64" "amd64" "16" "2019")
116116
run_check("1930" "x64" "x64" "amd64" "amd64" "amd64" "17" "2022")
117+
run_check("1940" "x64" "x64" "amd64" "amd64" "amd64" "17" "2022")
118+
run_check("1950" "x64" "x64" "amd64" "amd64" "amd64" "18" "2026")
117119

118120
# building for armv7
119121
run_check("1400" "ARMV7" "" "x86_arm" "x86" "arm" "8" "2005")

0 commit comments

Comments
 (0)