Skip to content

Commit

Permalink
Make Get-VendorPackages.ps1 more flexible and less error-prone (#2969)
Browse files Browse the repository at this point in the history
  • Loading branch information
tdcosta100 authored Oct 26, 2024
1 parent d5642a8 commit 35ec290
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions platform/windows/Get-VendorPackages.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,33 @@ foreach($letter in [byte][char]'Z'..[byte][char]'A')
if(-not (Test-Path $vcpkg_temp_dir))
{
& subst $vcpkg_temp_dir ([System.IO.Path]::Combine($PWD.Path, 'vendor', 'vcpkg'))
$env:VCPKG_ROOT = ('{0}\' -f $vcpkg_temp_dir)
break
}
}

switch($Renderer)
{
'EGL' { $renderer_packages = @('egl', 'opengl-registry'); break }
'OSMesa' { $renderer_packages = @(''); break }
'OSMesa' { $renderer_packages = @(); break }
'OpenGL' { $renderer_packages = @('opengl-registry'); break }
'Vulkan' { $renderer_packages = @(''); break }
'Vulkan' { $renderer_packages = @(); break }
}

if(-not (Test-Path "$vcpkg_temp_dir\vcpkg.exe"))
if(-not (Test-Path ('{0}\vcpkg.exe' -f $vcpkg_temp_dir)))
{
& "$vcpkg_temp_dir\bootstrap-vcpkg.bat"
& ('{0}\bootstrap-vcpkg.bat' -f $vcpkg_temp_dir)
}

& "$vcpkg_temp_dir\vcpkg.exe" --disable-metrics --overlay-triplets=$([System.IO.Path]::Combine($PWD.Path, 'vendor', 'vcpkg-custom-triplets')) --triplet=$($Triplet) --clean-after-build install curl dlfcn-win32 glfw3 icu libuv libjpeg-turbo libpng libwebp $($renderer_packages)
& ('{0}\vcpkg.exe' -f $vcpkg_temp_dir) $(
@(
'--disable-metrics',
('--overlay-triplets={0}' -f [System.IO.Path]::Combine($PWD.Path, 'vendor', 'vcpkg-custom-triplets')),
('--triplet={0}' -f $Triplet),
'--clean-after-build',
'install', 'curl', 'dlfcn-win32', 'glfw3', 'icu', 'libuv', 'libjpeg-turbo', 'libpng', 'libwebp'
) + $renderer_packages
)

subst $vcpkg_temp_dir /D

Expand Down

0 comments on commit 35ec290

Please sign in to comment.