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
43 changes: 31 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,25 @@ on:

jobs:
test-msvc-cppwinrt-build:
name: '${{ matrix.compiler }}: Build (${{ matrix.arch }}, ${{ matrix.config }})'
name: '${{ matrix.compiler }}: Build (${{ matrix.arch }}, ${{ matrix.config }}, ${{ matrix.toolchain.platform_toolset }})'
strategy:
matrix:
compiler: [MSVC, clang-cl]
arch: [x86, x64, arm64]
config: [Debug, Release]
toolchain:
- image: windows-2025
platform_toolset: v143
- image: windows-2025-vs2026
platform_toolset: v145
exclude:
- arch: arm64
config: Debug
- compiler: clang-cl
arch: arm64
- compiler: clang-cl
config: Release
runs-on: windows-latest
runs-on: ${{ matrix.toolchain.image }}
steps:
- uses: actions/checkout@v6

Expand All @@ -45,6 +50,8 @@ jobs:
$props = "Configuration=$target_configuration,Platform=$target_platform,CppWinRTBuildVersion=$target_version"
if ("${{ matrix.compiler }}" -eq "clang-cl") {
$props += ",Clang=1,PlatformToolset=ClangCl"
} else {
$props += ",PlatformToolset=${{ matrix.toolchain.platform_toolset }}"
}
Add-Content $env:GITHUB_ENV "msbuild_config_props=/p:$props"

Expand All @@ -68,7 +75,7 @@ jobs:
- name: Upload built executables
uses: actions/upload-artifact@v7
with:
name: msvc-build-${{ matrix.compiler}}-${{ matrix.arch }}-${{ matrix.config }}-bin
name: msvc-build-${{ matrix.compiler}}-${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.toolchain.platform_toolset }}-bin
path: |
_build/${{ matrix.arch }}/${{ matrix.config }}/*.exe
_build/${{ matrix.arch }}/${{ matrix.config }}/*.dll
Expand All @@ -84,7 +91,7 @@ jobs:
& "_build\$target_platform\$target_configuration\cppwinrt.exe" -in local -out _build\$target_platform\$target_configuration -verbose

test-msvc-cppwinrt-test:
name: '${{ matrix.compiler }}: Test [${{ matrix.test_exe }}] (${{ matrix.arch }}, ${{ matrix.config }})'
name: '${{ matrix.compiler }}: Test [${{ matrix.test_exe }}] (${{ matrix.arch }}, ${{ matrix.config }}, ${{ matrix.toolchain.platform_toolset }})'
needs: test-msvc-cppwinrt-build
strategy:
fail-fast: false
Expand All @@ -93,29 +100,34 @@ jobs:
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]
toolchain:
- image: windows-2025
platform_toolset: v143
- image: windows-2025-vs2026
platform_toolset: v145
exclude:
- arch: arm64
config: Debug
- compiler: clang-cl
arch: arm64
- compiler: clang-cl
config: Release
runs-on: windows-latest
runs-on: ${{ matrix.toolchain.image }}
steps:
- uses: actions/checkout@v6

- name: Fetch cppwinrt executables
if: matrix.arch != 'arm64'
uses: actions/download-artifact@v8
with:
name: msvc-build-${{ matrix.compiler}}-${{ matrix.arch }}-${{ matrix.config }}-bin
name: msvc-build-${{ matrix.compiler}}-${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.toolchain.platform_toolset }}-bin
path: _build/${{ matrix.arch }}/${{ matrix.config }}/

- name: Fetch x86 cppwinrt executables (arm64 only)
if: matrix.arch == 'arm64'
uses: actions/download-artifact@v8
with:
name: msvc-build-${{ matrix.compiler}}-x86-Release-bin
name: msvc-build-${{ matrix.compiler}}-x86-Release-${{ matrix.toolchain.platform_toolset }}-bin
path: _build/x86/Release/

- name: Download nuget
Expand All @@ -138,6 +150,8 @@ jobs:
$props = "Configuration=$target_configuration,Platform=$target_platform,CppWinRTBuildVersion=$target_version"
if ("${{ matrix.compiler }}" -eq "clang-cl") {
$props += ",Clang=1,PlatformToolset=ClangCl"
} else {
$props += ",PlatformToolset=${{ matrix.toolchain.platform_toolset }}"
}
Add-Content $env:GITHUB_ENV "msbuild_config_props=/p:$props"

Expand Down Expand Up @@ -232,7 +246,7 @@ jobs:
if: matrix.arch == 'arm64'
uses: actions/upload-artifact@v7
with:
name: msvc-tests-${{ matrix.test_exe }}-${{ matrix.compiler }}-${{ matrix.arch }}-${{ matrix.config }}-bin
name: msvc-tests-${{ matrix.test_exe }}-${{ matrix.compiler }}-${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.toolchain.platform_toolset }}-bin
path: |
_build/${{ matrix.arch }}/${{ matrix.config }}/*.exe
_build/${{ matrix.arch }}/${{ matrix.config }}/*.dll
Expand Down Expand Up @@ -313,22 +327,27 @@ jobs:
cmd /c "$env:VSDevCmd" "&" msbuild /m /clp:ForceConsoleColor "$env:msbuild_config_props" /p:Deployment=${{ matrix.Deployment }} natvis\cppwinrtvisualizer.sln

build-msvc-nuget-test:
name: 'Build nuget test (${{ matrix.arch }})'
name: 'Build nuget test (${{ matrix.arch }}, ${{ matrix.toolchain.platform_toolset }})'
needs: test-msvc-cppwinrt-build
strategy:
matrix:
compiler:
- MSVC
arch: [x86, x64]
config: [Release]
runs-on: windows-latest
toolchain:
- image: windows-2025
platform_toolset: v143
- image: windows-2025-vs2026
platform_toolset: v145
runs-on: ${{ matrix.toolchain.image }}
steps:
- uses: actions/checkout@v6

- name: Fetch cppwinrt executables
uses: actions/download-artifact@v8
with:
name: msvc-build-${{ matrix.compiler}}-${{ matrix.arch }}-${{ matrix.config }}-bin
name: msvc-build-${{ matrix.compiler}}-${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.toolchain.platform_toolset }}-bin
path: _build/${{ matrix.arch }}/${{ matrix.config }}/

- name: Download nuget
Expand All @@ -348,7 +367,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=${{ matrix.toolchain.platform_toolset }}"

- name: Restore nuget packages
run: |
Expand Down
2 changes: 1 addition & 1 deletion strings/base_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ WINRT_EXPORT namespace winrt

std::pair<std::uint32_t, impl::arg_out<T>> detach_abi() noexcept
{
#ifdef _MSC_VER
#if defined(_MSC_VER) && !defined(__clang__)
// https://github.com/microsoft/cppwinrt/pull/1165
std::pair<std::uint32_t, impl::arg_out<T>> result;
std::memset(&result, 0, sizeof(result));
Expand Down