Skip to content

Commit b2c6ce9

Browse files
authored
Update cmake-multi-platform.yml
1 parent a2bcb8f commit b2c6ce9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/cmake-multi-platform.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@ jobs:
2121
run: Get-ChildItem "C:\Program Files\Microsoft Visual Studio"
2222
- name: List installed Windows SDKs
2323
run: dir "C:\Program Files (x86)\Windows Kits\10\Lib"
24+
25+
- name: Detect latest Windows SDK version
26+
id: sdk
27+
shell: pwsh
28+
run: |
29+
$sdks = Get-ChildItem "C:\Program Files (x86)\Windows Kits\10\Lib" |
30+
Where-Object { $_.Name -match '^\d+\.\d+\.\d+\.\d+$' } |
31+
Sort-Object Name -Descending
32+
$latest = $sdks[0].Name
33+
"Latest SDK: $latest"
34+
echo "sdkver=$latest" >> $env:GITHUB_OUTPUT
2435
2536
- uses: ilammy/msvc-dev-cmd@v1
2637
- uses: actions/checkout@v4
@@ -39,6 +50,7 @@ jobs:
3950
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
4051
run: >
4152
cmake --preset x64-release
53+
-DCMAKE_SYSTEM_VERSION=${{ steps.sdk.outputs.sdkver }}
4254
-S ${{ github.workspace }}
4355
4456
- name: Build

0 commit comments

Comments
 (0)