diff --git a/.github/workflows/ci/matrix.json b/.github/workflows/ci/matrix.json index 9227dc2702..427727cd41 100644 --- a/.github/workflows/ci/matrix.json +++ b/.github/workflows/ci/matrix.json @@ -13,6 +13,7 @@ { "example": "foo", "toolchain": "nmake-vs-17-2022-win64-cxx17", "os": "windows-2022" }, { "example": "foo", "toolchain": "vs-17-2022-win64-sdk-10-0-22000-0-cxx17", "os": "windows-2022" }, { "example": "foo", "toolchain": "vs-17-2022-win64-store-10-cxx17", "os": "windows-2022" }, +{ "example": "foo", "toolchain": "ninja-vs-18-2026-win64-cxx17", "os": "windows-2025-vs2026" }, { "example": "foo", "toolchain": "mingw-cxx17", "os": "windows-2022" }, { "example": "foo", "toolchain": "msys-cxx17", "os": "windows-2022" } ] diff --git a/.github/workflows/set_matrix.py b/.github/workflows/set_matrix.py index 19aa175504..31ac037866 100755 --- a/.github/workflows/set_matrix.py +++ b/.github/workflows/set_matrix.py @@ -309,6 +309,13 @@ def generator_and_runscript(leg: dict): ) generator_str = "Visual Studio 17 2022" vcvarsall = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\Tools\\VsDevCmd.bat" + elif vs_version == "18": + if vs_year != "2026": + raise RuntimeError( + f"project: {project_name}: VS 18 expected to have year 2026" + ) + generator_str = "Visual Studio 18 2026" + vcvarsall = "C:\\Program Files\\Microsoft Visual Studio\\18\\Enterprise\\Common7\\Tools\\VsDevCmd.bat" else: raise RuntimeError( f"project: {project_name}: unhandled vs-generator: {m.group()} in toolchain: {toolchain}" diff --git a/cmake/modules/hunter_setup_msvc.cmake b/cmake/modules/hunter_setup_msvc.cmake index e5eed52671..1464110bf3 100644 --- a/cmake/modules/hunter_setup_msvc.cmake +++ b/cmake/modules/hunter_setup_msvc.cmake @@ -67,6 +67,7 @@ macro(hunter_setup_msvc) string(REGEX MATCH "^191[0-9]$" _vs_15_2017 "${MSVC_VERSION}") string(REGEX MATCH "^192[0-9]$" _vs_16_2019 "${MSVC_VERSION}") string(REGEX MATCH "^19[34][0-9]$" _vs_17_2022 "${MSVC_VERSION}") + string(REGEX MATCH "^195[0-9]$" _vs_18_2026 "${MSVC_VERSION}") if(_vs_8_2005) set(HUNTER_MSVC_VERSION "8") @@ -95,6 +96,9 @@ macro(hunter_setup_msvc) elseif(_vs_17_2022) set(HUNTER_MSVC_VERSION "17") set(HUNTER_MSVC_YEAR "2022") + elseif(_vs_18_2026) + set(HUNTER_MSVC_VERSION "18") + set(HUNTER_MSVC_YEAR "2026") else() hunter_internal_error("Unexpected MSVC_VERSION: '${MSVC_VERSION}'") endif() diff --git a/tests/hunter_setup_msvc/CMakeLists.txt b/tests/hunter_setup_msvc/CMakeLists.txt index 032b960fe5..a1d78f7bde 100644 --- a/tests/hunter_setup_msvc/CMakeLists.txt +++ b/tests/hunter_setup_msvc/CMakeLists.txt @@ -114,6 +114,8 @@ run_check("1920" "x64" "" "x86_amd64" "x86" "amd64" "16" "2019") run_check("1930" "x64" "" "x86_amd64" "x86" "amd64" "17" "2022") run_check("1920" "x64" "x64" "amd64" "amd64" "amd64" "16" "2019") run_check("1930" "x64" "x64" "amd64" "amd64" "amd64" "17" "2022") +run_check("1940" "x64" "x64" "amd64" "amd64" "amd64" "17" "2022") +run_check("1950" "x64" "x64" "amd64" "amd64" "amd64" "18" "2026") # building for armv7 run_check("1400" "ARMV7" "" "x86_arm" "x86" "arm" "8" "2005")