mirror of
https://github.com/jellyfin/jellyfin-desktop.git
synced 2026-10-26 16:45:24 +00:00
ci(windows): dynamically resolve MSVC path using vswhere
This commit is contained in:
1 parent
a8bab929c8
commit
cc39a53c42
1 file changed
+19
-3
@@ -72,15 +72,31 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir deps
|
mkdir deps
|
||||||
mkdir deps/vcruntime
|
mkdir deps/vcruntime
|
||||||
# Copy from VS 2022 Enterprise installation on runner
|
# Dynamically locate VS installation on runner
|
||||||
$vsRedist = Get-ChildItem "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\*\x64\Microsoft.VC143.CRT" | Select-Object -First 1
|
$vsPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -property installationPath
|
||||||
|
if (-not $vsPath) {
|
||||||
|
$vsPath = (Get-ChildItem "C:\Program Files\Microsoft Visual Studio\*\*" | Where-Object { Test-Path "$_\VC\Redist\MSVC" } | Select-Object -First 1).FullName
|
||||||
|
}
|
||||||
|
$vsRedist = Get-ChildItem "$vsPath\VC\Redist\MSVC\*\${{ matrix.vc_redist_arch }}\Microsoft.VC*.CRT" | Select-Object -First 1
|
||||||
|
if (-not $vsRedist) {
|
||||||
|
$vsRedist = Get-ChildItem "$vsPath\VC\Redist\MSVC" -Recurse -Filter "Microsoft.VC*.CRT" | Where-Object { $_.FullName -like "*${{ matrix.vc_redist_arch }}*" } | Select-Object -First 1
|
||||||
|
}
|
||||||
Copy-Item "$vsRedist\*.dll" deps/vcruntime/
|
Copy-Item "$vsRedist\*.dll" deps/vcruntime/
|
||||||
# Also grab VCRedist installer for optional system-wide install
|
# Also grab VCRedist installer for optional system-wide install
|
||||||
Invoke-WebRequest -Uri "https://aka.ms/vs/17/release/vc_redist.x64.exe" -OutFile deps/vc_redist.x64.exe
|
Invoke-WebRequest -Uri "https://aka.ms/vs/17/release/vc_redist.x64.exe" -OutFile deps/vc_redist.x64.exe
|
||||||
shell: powershell
|
shell: powershell
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\${{ matrix.vcvars }}"
|
set "VS_PATH="
|
||||||
|
for /f "tokens=*" %%i in ('"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -property installationPath 2^>nul') do set "VS_PATH=%%i"
|
||||||
|
if not defined VS_PATH (
|
||||||
|
for /d %%d in ("C:\Program Files\Microsoft Visual Studio\*") do (
|
||||||
|
for /d %%e in ("%%d\*") do (
|
||||||
|
if exist "%%e\VC\Auxiliary\Build\${{ matrix.vcvars }}" set "VS_PATH=%%e"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
call "%VS_PATH%\VC\Auxiliary\Build\${{ matrix.vcvars }}"
|
||||||
cd build
|
cd build
|
||||||
set PATH=%PATH%;C:\Program Files (x86)\Inno Setup 6;%CD%
|
set PATH=%PATH%;C:\Program Files (x86)\Inno Setup 6;%CD%
|
||||||
cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=output -DQTROOT=%QT_ROOT_DIR% -DMPV_INCLUDE_DIR=mpv/include -DMPV_LIBRARY=mpv/libmpv-2.dll -DCHECK_FOR_UPDATES=ON -DUSE_STATIC_MPVQT=ON ..
|
cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=output -DQTROOT=%QT_ROOT_DIR% -DMPV_INCLUDE_DIR=mpv/include -DMPV_LIBRARY=mpv/libmpv-2.dll -DCHECK_FOR_UPDATES=ON -DUSE_STATIC_MPVQT=ON ..
|
||||||
|
|||||||
Reference in new issue
Block a user