Skip to content

Commit a5f165d

Browse files
committed
2 parents a8c205a + b2c6ce9 commit a5f165d

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,24 @@ jobs:
1515
fail-fast: false
1616

1717
steps:
18+
- name: Check CMake version
19+
run: cmake --version
20+
- name: List installed Visual Studios
21+
run: Get-ChildItem "C:\Program Files\Microsoft Visual Studio"
22+
- name: List installed Windows SDKs
23+
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
35+
1836
- uses: ilammy/msvc-dev-cmd@v1
1937
- uses: actions/checkout@v4
2038
with:
@@ -32,6 +50,7 @@ jobs:
3250
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
3351
run: >
3452
cmake --preset x64-release
53+
-DCMAKE_SYSTEM_VERSION=${{ steps.sdk.outputs.sdkver }}
3554
-S ${{ github.workspace }}
3655
3756
- name: Build

0 commit comments

Comments
 (0)