Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/instructions/cppwinrt.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
- Use VS Developer Shell for correct toolset environment
- `cmake --build build --config Release --target cppwinrt` for cppwinrt.exe (or MSBuild: `msbuild cppwinrt\cppwinrt.vcxproj /p:Configuration=Release /p:Platform=x64`)
- NuGet tests: `msbuild test\nuget\NuGetTest.sln /p:Configuration=Release /p:Platform=x64`
- Module test projects require v145 toolset (VS 2026). Directory.Build.Props sets v143 by default — override with `<PlatformToolset>v145</PlatformToolset>` in Configuration PropertyGroup
- Module test projects require v145 toolset (VS 2026). Directory.Build.Props selects v145 when VisualStudioVersion >= 18.0 (VS 2026) and falls back to v143 otherwise; override `<PlatformToolset>` in the Configuration PropertyGroup to force a specific toolset

## Key Patterns

Expand Down
26 changes: 7 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ jobs:
arch: [x86, x64, arm64]
config: [Debug, Release]
toolchain:
- image: windows-2025
platform_toolset: v143
- image: windows-2025-vs2026
platform_toolset: v145
exclude:
Expand Down Expand Up @@ -99,10 +97,8 @@ jobs:
compiler: [MSVC, clang-cl]
arch: [x86, x64, arm64]
config: [Debug, Release]
test_exe: [test, test_nocoro, test_cpp20, test_cpp20_no_sourcelocation, test_fast, test_slow, test_old, test_module_lock_custom, test_module_lock_none]
test_exe: [test, test_nocoro, test_cpp20, test_cpp20_no_sourcelocation, test_cpp20_module, test_fast, test_slow, test_old, test_module_lock_custom, test_module_lock_none]
toolchain:
- image: windows-2025
platform_toolset: v143
- image: windows-2025-vs2026
platform_toolset: v145
exclude:
Expand All @@ -112,6 +108,9 @@ jobs:
arch: arm64
- compiler: clang-cl
config: Release
# C++20 named modules require the MSVC v145 toolset; clang-cl is not supported.
- compiler: clang-cl
test_exe: test_cpp20_module
runs-on: ${{ matrix.toolchain.image }}
steps:
- uses: actions/checkout@v6
Expand Down Expand Up @@ -295,7 +294,7 @@ jobs:
arch: [x86, x64, arm64]
config: [Release]
Deployment: [Component, Standalone]
runs-on: windows-latest
runs-on: windows-2025-vs2026
steps:
- uses: actions/checkout@v6

Expand All @@ -316,7 +315,7 @@ jobs:
$target_configuration = "${{ matrix.config }}"
$target_platform = "${{ matrix.arch }}"
$target_version = "999.999.999.999"
Add-Content $env:GITHUB_ENV "msbuild_config_props=/p:Configuration=$target_configuration,Platform=$target_platform,CppWinRTBuildVersion=$target_version"
Add-Content $env:GITHUB_ENV "msbuild_config_props=/p:Configuration=$target_configuration,Platform=$target_platform,CppWinRTBuildVersion=$target_version,PlatformToolset=v145"

- name: Restore nuget packages
run: |
Expand All @@ -336,8 +335,6 @@ jobs:
arch: [x86, x64]
config: [Release]
toolchain:
- image: windows-2025
platform_toolset: v143
- image: windows-2025-vs2026
platform_toolset: v145
runs-on: ${{ matrix.toolchain.image }}
Expand Down Expand Up @@ -378,23 +375,14 @@ jobs:
$target_configuration = "${{ matrix.config }}"
$target_platform = "${{ matrix.arch }}"
& "_build\$target_platform\$target_configuration\cppwinrt.exe" -in local -out _build\$target_platform\$target_configuration -verbose

- name: Remove module test projects on v143
if: matrix.toolchain.platform_toolset == 'v143'
run: |
# Module test projects require v145 toolset
mv test\nuget\NugetTest.sln test\nuget\NugetTest.sln.orig
Get-Content test\nuget\NugetTest.sln.orig |
Where-Object { -not ($_ -match 'TestModule') } |
Set-Content test\nuget\NugetTest.sln

- name: Run nuget test
run: |
cmd /c "$env:VSDevCmd" "&" msbuild /m /clp:ForceConsoleColor "$env:msbuild_config_props" test\nuget\NugetTest.sln

build-nuget:
name: Build nuget package with MSVC
runs-on: windows-latest
runs-on: windows-2025-vs2026
steps:
- uses: actions/checkout@v6

Expand Down
3 changes: 3 additions & 0 deletions Directory.Build.Props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
<!-- Set common MSBuild properties and item metadata for CppWinRT tool and tests -->

<PropertyGroup>
<!-- Use the v145 toolset on Visual Studio 2026 (VisualStudioVersion 18.0) and later,
where it is available; fall back to v143 on older Visual Studio (e.g. 2022). -->
<PlatformToolset>v143</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' &gt;= '18.0'">v145</PlatformToolset>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.18362.0</WindowsTargetPlatformMinVersion>
</PropertyGroup>
Expand Down
1 change: 0 additions & 1 deletion test/nuget/TestProxyStub/TestProxyStub.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
Expand Down