Skip to content

Commit 97cc5da

Browse files
Merge branch 'master' into unbox_value_or-hstring
2 parents 04eec61 + a5e9452 commit 97cc5da

12 files changed

Lines changed: 60 additions & 31 deletions

File tree

.github/workflows/ci.yml

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,25 @@ on:
88

99
jobs:
1010
test-msvc-cppwinrt-build:
11-
name: '${{ matrix.compiler }}: Build (${{ matrix.arch }}, ${{ matrix.config }})'
11+
name: '${{ matrix.compiler }}: Build (${{ matrix.arch }}, ${{ matrix.config }}, ${{ matrix.toolchain.platform_toolset }})'
1212
strategy:
1313
matrix:
1414
compiler: [MSVC, clang-cl]
1515
arch: [x86, x64, arm64]
1616
config: [Debug, Release]
17+
toolchain:
18+
- image: windows-2025
19+
platform_toolset: v143
20+
- image: windows-2025-vs2026
21+
platform_toolset: v145
1722
exclude:
1823
- arch: arm64
1924
config: Debug
2025
- compiler: clang-cl
2126
arch: arm64
2227
- compiler: clang-cl
2328
config: Release
24-
runs-on: windows-latest
29+
runs-on: ${{ matrix.toolchain.image }}
2530
steps:
2631
- uses: actions/checkout@v6
2732

@@ -41,10 +46,12 @@ jobs:
4146
run: |
4247
$target_configuration = "${{ matrix.config }}"
4348
$target_platform = "${{ matrix.arch }}"
44-
$target_version = "1.2.3.4"
49+
$target_version = "999.999.999.999"
4550
$props = "Configuration=$target_configuration,Platform=$target_platform,CppWinRTBuildVersion=$target_version"
4651
if ("${{ matrix.compiler }}" -eq "clang-cl") {
4752
$props += ",Clang=1,PlatformToolset=ClangCl"
53+
} else {
54+
$props += ",PlatformToolset=${{ matrix.toolchain.platform_toolset }}"
4855
}
4956
Add-Content $env:GITHUB_ENV "msbuild_config_props=/p:$props"
5057
@@ -68,7 +75,7 @@ jobs:
6875
- name: Upload built executables
6976
uses: actions/upload-artifact@v7
7077
with:
71-
name: msvc-build-${{ matrix.compiler}}-${{ matrix.arch }}-${{ matrix.config }}-bin
78+
name: msvc-build-${{ matrix.compiler}}-${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.toolchain.platform_toolset }}-bin
7279
path: |
7380
_build/${{ matrix.arch }}/${{ matrix.config }}/*.exe
7481
_build/${{ matrix.arch }}/${{ matrix.config }}/*.dll
@@ -84,7 +91,7 @@ jobs:
8491
& "_build\$target_platform\$target_configuration\cppwinrt.exe" -in local -out _build\$target_platform\$target_configuration -verbose
8592
8693
test-msvc-cppwinrt-test:
87-
name: '${{ matrix.compiler }}: Test [${{ matrix.test_exe }}] (${{ matrix.arch }}, ${{ matrix.config }})'
94+
name: '${{ matrix.compiler }}: Test [${{ matrix.test_exe }}] (${{ matrix.arch }}, ${{ matrix.config }}, ${{ matrix.toolchain.platform_toolset }})'
8895
needs: test-msvc-cppwinrt-build
8996
strategy:
9097
fail-fast: false
@@ -93,29 +100,34 @@ jobs:
93100
arch: [x86, x64, arm64]
94101
config: [Debug, Release]
95102
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]
103+
toolchain:
104+
- image: windows-2025
105+
platform_toolset: v143
106+
- image: windows-2025-vs2026
107+
platform_toolset: v145
96108
exclude:
97109
- arch: arm64
98110
config: Debug
99111
- compiler: clang-cl
100112
arch: arm64
101113
- compiler: clang-cl
102114
config: Release
103-
runs-on: windows-latest
115+
runs-on: ${{ matrix.toolchain.image }}
104116
steps:
105117
- uses: actions/checkout@v6
106118

107119
- name: Fetch cppwinrt executables
108120
if: matrix.arch != 'arm64'
109121
uses: actions/download-artifact@v8
110122
with:
111-
name: msvc-build-${{ matrix.compiler}}-${{ matrix.arch }}-${{ matrix.config }}-bin
123+
name: msvc-build-${{ matrix.compiler}}-${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.toolchain.platform_toolset }}-bin
112124
path: _build/${{ matrix.arch }}/${{ matrix.config }}/
113125

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

121133
- name: Download nuget
@@ -134,10 +146,12 @@ jobs:
134146
run: |
135147
$target_configuration = "${{ matrix.config }}"
136148
$target_platform = "${{ matrix.arch }}"
137-
$target_version = "1.2.3.4"
149+
$target_version = "999.999.999.999"
138150
$props = "Configuration=$target_configuration,Platform=$target_platform,CppWinRTBuildVersion=$target_version"
139151
if ("${{ matrix.compiler }}" -eq "clang-cl") {
140152
$props += ",Clang=1,PlatformToolset=ClangCl"
153+
} else {
154+
$props += ",PlatformToolset=${{ matrix.toolchain.platform_toolset }}"
141155
}
142156
Add-Content $env:GITHUB_ENV "msbuild_config_props=/p:$props"
143157
@@ -232,7 +246,7 @@ jobs:
232246
if: matrix.arch == 'arm64'
233247
uses: actions/upload-artifact@v7
234248
with:
235-
name: msvc-tests-${{ matrix.test_exe }}-${{ matrix.compiler }}-${{ matrix.arch }}-${{ matrix.config }}-bin
249+
name: msvc-tests-${{ matrix.test_exe }}-${{ matrix.compiler }}-${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.toolchain.platform_toolset }}-bin
236250
path: |
237251
_build/${{ matrix.arch }}/${{ matrix.config }}/*.exe
238252
_build/${{ matrix.arch }}/${{ matrix.config }}/*.dll
@@ -301,7 +315,7 @@ jobs:
301315
run: |
302316
$target_configuration = "${{ matrix.config }}"
303317
$target_platform = "${{ matrix.arch }}"
304-
$target_version = "1.2.3.4"
318+
$target_version = "999.999.999.999"
305319
Add-Content $env:GITHUB_ENV "msbuild_config_props=/p:Configuration=$target_configuration,Platform=$target_platform,CppWinRTBuildVersion=$target_version"
306320
307321
- name: Restore nuget packages
@@ -313,22 +327,27 @@ jobs:
313327
cmd /c "$env:VSDevCmd" "&" msbuild /m /clp:ForceConsoleColor "$env:msbuild_config_props" /p:Deployment=${{ matrix.Deployment }} natvis\cppwinrtvisualizer.sln
314328
315329
build-msvc-nuget-test:
316-
name: 'Build nuget test (${{ matrix.arch }})'
330+
name: 'Build nuget test (${{ matrix.arch }}, ${{ matrix.toolchain.platform_toolset }})'
317331
needs: test-msvc-cppwinrt-build
318332
strategy:
319333
matrix:
320334
compiler:
321335
- MSVC
322336
arch: [x86, x64]
323337
config: [Release]
324-
runs-on: windows-latest
338+
toolchain:
339+
- image: windows-2025
340+
platform_toolset: v143
341+
- image: windows-2025-vs2026
342+
platform_toolset: v145
343+
runs-on: ${{ matrix.toolchain.image }}
325344
steps:
326345
- uses: actions/checkout@v6
327346

328347
- name: Fetch cppwinrt executables
329348
uses: actions/download-artifact@v8
330349
with:
331-
name: msvc-build-${{ matrix.compiler}}-${{ matrix.arch }}-${{ matrix.config }}-bin
350+
name: msvc-build-${{ matrix.compiler}}-${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.toolchain.platform_toolset }}-bin
332351
path: _build/${{ matrix.arch }}/${{ matrix.config }}/
333352

334353
- name: Download nuget
@@ -347,8 +366,8 @@ jobs:
347366
run: |
348367
$target_configuration = "${{ matrix.config }}"
349368
$target_platform = "${{ matrix.arch }}"
350-
$target_version = "1.2.3.4"
351-
Add-Content $env:GITHUB_ENV "msbuild_config_props=/p:Configuration=$target_configuration,Platform=$target_platform,CppWinRTBuildVersion=$target_version"
369+
$target_version = "999.999.999.999"
370+
Add-Content $env:GITHUB_ENV "msbuild_config_props=/p:Configuration=$target_configuration,Platform=$target_platform,CppWinRTBuildVersion=$target_version,PlatformToolset=${{ matrix.toolchain.platform_toolset }}"
352371
353372
- name: Restore nuget packages
354373
run: |

.pipelines/OneBranch.Official.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ variables:
1212
parameters:
1313
debug: ${{ parameters.debug }}
1414

15-
name: 2.0.$(date:yyMMdd)$(rev:.r)
15+
name: 3.0.$(date:yyMMdd)$(rev:.r)
1616

1717
trigger: none
1818

.pipelines/OneBranch.PullRequest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ variables:
1010
parameters:
1111
debug: ${{ parameters.debug }}
1212

13-
name: PullRequest_2.0.$(date:yyMMdd)$(rev:.r)
13+
name: PullRequest_3.0.$(date:yyMMdd)$(rev:.r)
1414

1515
trigger: none
1616

.pipelines/variables/version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ parameters:
44
default: false
55

66
variables:
7-
MajorVersion: "2"
7+
MajorVersion: "3"
88
MinorVersion: "0"
99
VersionDate: $[format('{0:yyMMdd}', pipeline.startTime)]
1010
VersionCounter: $[counter(variables['VersionDate'], 1)]

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ project(cppwinrt LANGUAGES CXX)
1313
set(CMAKE_CXX_STANDARD 17)
1414
set(CMAKE_CXX_STANDARD_REQUIRED True)
1515

16-
set(CPPWINRT_BUILD_VERSION "2.3.4.5" CACHE STRING "The version string used for cppwinrt.")
17-
if(CPPWINRT_BUILD_VERSION STREQUAL "2.3.4.5" OR CPPWINRT_BUILD_VERSION STREQUAL "0.0.0.0")
16+
set(CPPWINRT_BUILD_VERSION "999.999.999.999" CACHE STRING "The version string used for cppwinrt.")
17+
if(CPPWINRT_BUILD_VERSION STREQUAL "999.999.999.999" OR CPPWINRT_BUILD_VERSION STREQUAL "0.0.0.0")
1818
message(WARNING "CPPWINRT_BUILD_VERSION has been set to a dummy version string. Do not use in production!")
1919
endif()
2020
message(STATUS "Using version string: ${CPPWINRT_BUILD_VERSION}")

Directory.Build.Props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
</PropertyGroup>
3838

3939
<PropertyGroup>
40-
<CppWinRTBuildVersion Condition="'$(CppWinRTBuildVersion)'==''">2.3.4.5</CppWinRTBuildVersion>
40+
<CppWinRTBuildVersion Condition="'$(CppWinRTBuildVersion)'==''">999.999.999.999</CppWinRTBuildVersion>
4141
<CppWinRTPlatform>$(Platform)</CppWinRTPlatform>
4242
<CppWinRTPlatform Condition="'$(Platform)'=='Win32'">x86</CppWinRTPlatform>
4343
<OutDir>$(SolutionDir)_build\$(CppWinRTPlatform)\$(Configuration)\</OutDir>

build_nuget.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
rem @echo off
22

33
set target_version=%1
4-
if "%target_version%"=="" set target_version=3.0.0.0
4+
if "%target_version%"=="" set target_version=999.999.999.999
55

66
call msbuild /m /p:Configuration=Release,Platform=x86,CppWinRTBuildVersion=%target_version% cppwinrt.sln /t:fast_fwd
77
call msbuild /m /p:Configuration=Release,Platform=x64,CppWinRTBuildVersion=%target_version% cppwinrt.sln /t:fast_fwd

build_test_all.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set clean_intermediate_files=%4
77

88
if "%target_platform%"=="" set target_platform=x64
99
if "%target_configuration%"=="" set target_configuration=Release
10-
if "%target_version%"=="" set target_version=1.2.3.4
10+
if "%target_version%"=="" set target_version=999.999.999.999
1111

1212
if not exist ".\.nuget" mkdir ".\.nuget"
1313
if not exist ".\.nuget\nuget.exe" powershell -Command "$ProgressPreference = 'SilentlyContinue' ; Invoke-WebRequest https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -OutFile .\.nuget\nuget.exe"

build_vsix.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set target_version=%2
66
set target_deployment=%3
77

88
if "%target_configuration%"=="" set target_configuration=Release
9-
if "%target_version%"=="" set target_version=1.2.3.4
9+
if "%target_version%"=="" set target_version=999.999.999.999
1010
if "%target_deployment%"=="" set target_deployment=Standalone
1111

1212
if not exist ".\.nuget" mkdir ".\.nuget"

prebuild/main.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,19 @@ namespace cppwinrt::strings {
7777

7878
writer version_rc;
7979

80+
// Extract major.minor substrings from CPPWINRT_VERSION_STRING (e.g. "3.0.250316.1")
81+
std::string_view const full_version{ CPPWINRT_VERSION_STRING };
82+
auto const first_dot = full_version.find('.');
83+
auto const second_dot = full_version.find('.', first_dot + 1);
84+
auto const ver_major = full_version.substr(0, first_dot);
85+
auto const ver_minor = full_version.substr(first_dot + 1, second_dot - first_dot - 1);
86+
8087
version_rc.write(R"(
8188
#include "winres.h"
8289
8390
VS_VERSION_INFO VERSIONINFO
84-
FILEVERSION 2,0,0,0
85-
PRODUCTVERSION 2,0,0,0
91+
FILEVERSION %,%,0,0
92+
PRODUCTVERSION %,%,0,0
8693
FILEFLAGSMASK 0x3fL
8794
#ifdef _DEBUG
8895
FILEFLAGS 0x1L
@@ -99,7 +106,7 @@ BEGIN
99106
BEGIN
100107
VALUE "CompanyName", "Microsoft Corporation"
101108
VALUE "FileDescription", "C++/WinRT"
102-
VALUE "FileVersion", "2.0.0.0"
109+
VALUE "FileVersion", "%.%.0.0"
103110
VALUE "LegalCopyright", "Microsoft Corporation. All rights reserved."
104111
VALUE "OriginalFilename", "cppwinrt.exe"
105112
VALUE "ProductName", "C++/WinRT"
@@ -112,7 +119,10 @@ BEGIN
112119
END
113120
END
114121
)",
115-
CPPWINRT_VERSION_STRING);
122+
ver_major, ver_minor, // FILEVERSION
123+
ver_major, ver_minor, // PRODUCTVERSION
124+
ver_major, ver_minor, // FileVersion string
125+
CPPWINRT_VERSION_STRING); // ProductVersion string
116126

117127
std::filesystem::create_directories(argv[2]);
118128
auto const output = std::filesystem::canonical(argv[2]);

0 commit comments

Comments
 (0)