Skip to content

Commit

Permalink
ci/win32: add shaderc
Browse files Browse the repository at this point in the history
Use pre-built binaries to reduce CI build time.
  • Loading branch information
kasper93 committed May 11, 2024
1 parent 5524191 commit 42b3890
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions ci/build-win32.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,31 @@ if (-not (Test-Path $subprojects)) {
New-Item -Path $subprojects -ItemType Directory | Out-Null
}

# Download pre-built shaderc, it is quite big to build each time
# For download link see https://github.com/google/shaderc/blob/main/downloads.md
$url = "https://storage.googleapis.com/shaderc/badges/build_link_windows_vs2019_release.html"
$shaderc = "shaderc.zip"
$resp = Invoke-WebRequest -Uri $url
if ($resp.Content -match '<meta http-equiv="refresh" content="\d+; url=(?<url>[^"]+)"') {
$url = $matches['url']
}
Invoke-WebRequest -Uri $url -OutFile $shaderc
if (Test-Path "$subprojects/shaderc") {
Remove-Item -LiteralPath "$subprojects/shaderc" -Force -Recurse
}
Expand-Archive -Path $shaderc -DestinationPath "$subprojects/shaderc"
Move-Item -Path "$subprojects/shaderc/install/*" -Destination "$subprojects/shaderc"

Set-Content -Path "$subprojects/shaderc/meson.build" -Value @"
project('shaderc', 'c', version: '2024.1')
cc = meson.get_compiler('c')
shaderc_dep = declare_dependency(
dependencies: cc.find_library('shaderc_combined', dirs: meson.current_source_dir() / 'lib'),
include_directories: include_directories('include')
)
meson.override_dependency('shaderc', shaderc_dep)
"@

$projects = @(
@{
Path = "$subprojects/ffmpeg.wrap"
Expand Down Expand Up @@ -68,6 +93,7 @@ meson setup build `
-Dlcms2:fastfloat=true `
-Dlibplacebo:demos=false `
-Dlibplacebo:lcms=enabled `
-Dlibplacebo:shaderc=enabled `
-Dlibplacebo:vulkan=enabled `
-Djavascript=enabled
ninja -C build mpv.exe mpv.com libmpv.a
Expand Down

0 comments on commit 42b3890

Please sign in to comment.