Skip to content

Commit

Permalink
vswhere
Browse files Browse the repository at this point in the history
  • Loading branch information
riverar committed May 24, 2024
1 parent 98fbe7b commit b10723a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
9 changes: 6 additions & 3 deletions .github/actions/fix-environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ runs:
- name: Configure environment
shell: pwsh
run: |
$vs_root = & 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe' `
-latest -property installationPath -format value
switch -Wildcard ("${{ matrix.target }}")
{
"*-pc-windows-gnu"
Expand All @@ -27,19 +30,19 @@ runs:
"i686*"
{
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x86" >> $env:GITHUB_PATH
((Resolve-Path "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\*\bin\Hostx86\x86")
((Resolve-Path "$vs_root\VC\Tools\MSVC\*\bin\Hostx86\x86")
| Sort-Object -Descending | Select -First 1).ToString() >> $env:GITHUB_PATH
}
"x86_64*"
{
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64" >> $env:GITHUB_PATH
((Resolve-Path "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\*\bin\Hostx64\x64")
((Resolve-Path "$vs_root\VC\Tools\MSVC\*\bin\Hostx64\x64")
| Sort-Object -Descending | Select -First 1).ToString() >> $env:GITHUB_PATH
}
"aarch64*"
{
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64" >> $env:GITHUB_PATH
((Resolve-Path "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\*\bin\Hostx64\x64")
((Resolve-Path "$vs_root\VC\Tools\MSVC\*\bin\Hostx64\x64")
| Sort-Object -Descending | Select -First 1).ToString() >> $env:GITHUB_PATH
}
"*"
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,30 @@ jobs:
set PATH=C:\msys64\mingw64\bin;%PATH%
cargo run -p tool_gnu -- all
- name: Find Visual Studio
id: visual-studio
shell: pwsh
run: |
$path = & 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe' `
-latest -property installationPath -format value
Write-Output "install_path=$path" >> $env::GITHUB_OUTPUT
- name: Build i686_msvc
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars32.bat" x86
call "${{steps.visual-studio.outputs.install_path}}\VC\Auxiliary\Build\vcvars32.bat" x86
cargo run -p tool_msvc
- name: Build x86_64_msvc
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars32.bat" amd64
call "${{steps.visual-studio.outputs.install_path}}\VC\Auxiliary\Build\vcvars32.bat" amd64
cargo run -p tool_msvc
- name: Build aarch64_msvc
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars32.bat" amd64_arm64
call "${{steps.visual-studio.outputs.install_path}}\VC\Auxiliary\Build\vcvars32.bat" amd64_arm64
cargo run -p tool_msvc
- name: Upload libs
Expand All @@ -60,7 +68,7 @@ jobs:
- name: Check dumpbin
shell: pwsh
run: |
$VisualStudioRoot = & vswhere -latest -property installationPath -format value
$VisualStudioRoot = "${{steps.visual-studio.outputs.install_path}}"
$DumpbinPath = Resolve-Path "$VisualStudioRoot\VC\Tools\MSVC\*\bin\*\x86\dumpbin.exe" |
Select -ExpandProperty Path -First 1
$Tests = @(
Expand Down

0 comments on commit b10723a

Please sign in to comment.