Skip to content

Commit 28939d3

Browse files
committed
Use vswhere to detect PlatformToolset
1 parent f48af1a commit 28939d3

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

.github/workflows/windows-check.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,22 @@ jobs:
2929
- name: Add MSBuild to PATH
3030
uses: microsoft/setup-msbuild@v2
3131

32-
- name: Restore wolfSSL NuGet packages
33-
run: nuget restore wolfssl/wolfssl64.sln
34-
3532
- name: Replace user_settings.h
3633
run: cp wolfclu/ide/winvs/user_settings.h wolfssl/IDE/WIN/user_settings.h
3734

38-
- name: Build wolfSSL
39-
run: msbuild /m /p:Platform=${{ env.BUILD_PLATFORM }} /p:Configuration=${{ env.BUILD_CONFIGURATION }} wolfssl/wolfssl64.sln
35+
- name: Detect platform toolset
36+
id: toolset
37+
run: |
38+
$major = (vswhere -latest -property installationVersion).Split('.')[0]
39+
$ts = @{ "16" = "v142"; "17" = "v143"; "18" = "v144" }[$major]
40+
echo "value=$ts" >> $env:GITHUB_OUTPUT
4041
41-
- name: Restore wolfCLU NuGet packages
42-
working-directory: wolfclu
43-
run: nuget restore wolfclu.sln
42+
- name: Build wolfSSL
43+
run: msbuild /m /p:PlatformToolset=${{ steps.toolset.outputs.value }} /p:Platform=${{ env.BUILD_PLATFORM }} /p:Configuration=${{ env.BUILD_CONFIGURATION }} wolfssl/wolfssl64.sln
4444

4545
- name: Build wolfCLU
4646
working-directory: wolfclu
47-
run: msbuild /m /p:Platform=${{ env.BUILD_PLATFORM }} /p:Configuration=${{ env.BUILD_CONFIGURATION }} wolfclu.sln
47+
run: msbuild /m /p:PlatformToolset=${{ steps.toolset.outputs.value }} /p:Platform=${{ env.BUILD_PLATFORM }} /p:Configuration=${{ env.BUILD_CONFIGURATION }} wolfclu.sln
4848

4949
- name: Run tests
5050
working-directory: wolfclu

0 commit comments

Comments
 (0)