Skip to content

Commit

Permalink
libva: Use MSYS2 package
Browse files Browse the repository at this point in the history
  • Loading branch information
pal1000 committed Jan 26, 2023
1 parent 6da85be commit 59e6f6a
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 33 deletions.
6 changes: 3 additions & 3 deletions buildscript/build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@
@rem If using MSVC do SPIR-V Tools build
@IF %toolchain%==msvc call "%devroot%\%projectname%\buildscript\modules\spirv.cmd"

@rem If using MSVC do VA-API library build
@IF %toolchain%==msvc call "%devroot%\%projectname%\buildscript\modules\libva.cmd"

@rem If using MSYS2 Mingw-w64 update MSYS2 packages
@IF NOT %toolchain%==msvc call "%devroot%\%projectname%\buildscript\modules\msysupdate.cmd"

@rem If using MSYS2 Mingw-w64 install necessary packages
@IF NOT %toolchain%==msvc call "%devroot%\%projectname%\buildscript\modules\msyspackages.cmd"

@rem VA-API library build
@call "%devroot%\%projectname%\buildscript\modules\libva.cmd"

@rem If using MSVC do LLVM build.
@IF %toolchain%==msvc call "%devroot%\%projectname%\buildscript\modules\llvm.cmd"
@IF %toolchain%==msvc call "%devroot%\%projectname%\buildscript\modules\libclc.cmd"
Expand Down
8 changes: 3 additions & 5 deletions buildscript/modules/envdump.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,9 @@ set "exitloop="
)

@rem Get libva and VA-API versions
@IF EXIST "%devroot%\libva\build\%toolchain%-%abi%\lib\pkgconfig\libva-win32.pc" for /f tokens^=1^-2^ delims^=^=^ eol^= %%a IN ('type "%devroot%\libva\build\%toolchain%-%abi%\lib\pkgconfig\libva-win32.pc"') DO @(
@IF %toolchain%==msvc if "%%a"=="libva_version" echo libva %%b>>"%devroot%\%projectname%\buildinfo\msvc.txt"
@IF NOT %toolchain%==msvc if "%%a"=="libva_version" echo libva %%b>>"%devroot%\%projectname%\buildinfo\mingw.txt"
@IF %toolchain%==msvc if "%%a"=="va_api_version" echo VA-API %%b>>"%devroot%\%projectname%\buildinfo\msvc.txt"
@IF NOT %toolchain%==msvc if "%%a"=="va_api_version" echo VA-API %%b>>"%devroot%\%projectname%\buildinfo\mingw.txt"
@IF %toolchain%==msvc IF EXIST "%devroot%\libva\build\%abi%\lib\pkgconfig\libva-win32.pc" for /f tokens^=1^-2^ delims^=^=^ eol^= %%a IN ('type "%devroot%\libva\build\%abi%\lib\pkgconfig\libva-win32.pc"') DO @(
@if "%%a"=="libva_version" echo libva %%b>>"%devroot%\%projectname%\buildinfo\msvc.txt"
@if "%%a"=="va_api_version" echo VA-API %%b>>"%devroot%\%projectname%\buildinfo\msvc.txt"
)

@rem Get DirectX headers version
Expand Down
31 changes: 10 additions & 21 deletions buildscript/modules/libva.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,50 +14,39 @@
@git checkout 2.17.0
)
@IF %gitstate% GTR 0 echo.
@IF %toolchain%==msvc IF "%pkgconfigstate%"=="0" GOTO nolibva
@IF "%pkgconfigstate%"=="0" GOTO nolibva
@set /p buildlibva=Do you want to build VA-API library (y/n):
@echo.
@IF /I NOT "%buildlibva%"=="y" GOTO nolibva

@IF %toolchain%==msvc call %vsenv% %vsabi%
@IF %toolchain%==msvc cd "%devroot%\libva"
@IF %toolchain%==msvc echo.
@call %vsenv% %vsabi%
@cd "%devroot%\libva"
@echo.
@IF NOT EXIST "build\" MD build
@echo Cleanning VA-API library build...
@echo.
@IF EXIST "build\%toolchain%-%abi%" RD /S /Q build\%toolchain%-%abi%
@IF EXIST "build\buildsys-%toolchain%-%abi%" RD /S /Q build\buildsys-%toolchain%-%abi%
@IF EXIST "build\%abi%" RD /S /Q build\%abi%
@IF EXIST "build\buildsys-%abi%" RD /S /Q build\buildsys-%abi%

@call "%devroot%\%projectname%\buildscript\modules\useninja.cmd"
@IF %toolchain%==msvc IF NOT "%pkgconfigstate%"=="0" set PATH=%pkgconfigloc%\;%PATH%

@IF NOT %toolchain%==msvc IF %abi%==aarch64 set CFLAGS=-march^=armv8-a -pipe
@IF NOT %toolchain%==msvc IF NOT %abi%==aarch64 set CFLAGS=-march^=core2 -pipe
@IF NOT "%pkgconfigstate%"=="0" set PATH=%pkgconfigloc%\;%PATH%

@set buildconf=%mesonloc% setup build/buildsys-%toolchain%-%abi% --buildtype=release --pkgconfig.relocatable --prefix="%devroot:\=/%/libva/build/%toolchain%-%abi%"
@set buildconf=%mesonloc% setup build/buildsys-%abi% --buildtype=release --pkgconfig.relocatable --prefix="%devroot:\=/%/libva/build/%abi%" -Db_vscrt=mt
@IF /I NOT "%useninja%"=="y" set buildconf=%buildconf% --backend=vs
@IF /I "%useninja%"=="y" set buildconf=%buildconf% --backend=ninja
@IF NOT %toolchain%==msvc set /p dynamiclink=Link binaries dynamically (y/n):
@IF NOT %toolchain%==msvc echo.
@IF NOT %toolchain%==msvc set buildconf=%buildconf% -Dc_args="%CFLAGS%" -Dcpp_args="%CFLAGS%"
@IF /I "%dynamiclink%"=="y" set buildconf=%buildconf% -Dc_link_args="-s" -Dcpp_link_args="-s"
@IF NOT %toolchain%==msvc IF /I NOT "%dynamiclink%"=="y" set buildconf=%buildconf% --prefer-static -Dc_link_args="-s -static" -Dcpp_link_args="-s -static"
@IF %toolchain%==msvc set buildconf=%buildconf% -Db_vscrt=mt
@IF NOT %toolchain%==msvc set CFLAGS=

@echo Configuring VA-API build with : %buildconf%
@echo.
@%buildconf%
@echo.
@pause
@echo.
@cd build\buildsys-%toolchain%-%abi%
@cd build\buildsys-%abi%

@IF /I NOT "%useninja%"=="y" IF %abi%==x64 set buildcmd=msbuild /p^:Configuration=release,Platform=x64 libva.sln /m^:%throttle% ^&^& msbuild /p^:Configuration=release,Platform=x64 RUN_INSTALL.vcxproj /m^:%throttle%
@IF /I NOT "%useninja%"=="y" IF %abi%==x86 set buildcmd=msbuild /p^:Configuration=release,Platform=Win32 libva.sln /m^:%throttle% ^&^& msbuild /p^:Configuration=release,Platform=Win32 RUN_INSTALL.vcxproj /m^:%throttle%
@IF /I NOT "%useninja%"=="y" IF %abi%==aarch64 set buildcmd=msbuild /p^:Configuration=release,Platform=ARM64 libva.sln /m^:%throttle% ^&^& msbuild /p^:Configuration=release,Platform=ARM64 RUN_INSTALL.vcxproj /m^:%throttle%
@IF /I "%useninja%"=="y" IF %toolchain%==msvc set buildcmd=ninja -j %throttle% install
@IF NOT %toolchain%==msvc set buildcmd=%runmsys% /%LMSYSTEM%/bin/ninja -j %throttle% install
@IF /I "%useninja%"=="y" set buildcmd=ninja -j %throttle% install
@echo Performing VA-API build with ^: %buildcmd%
@echo.
@%buildcmd%
Expand Down
6 changes: 3 additions & 3 deletions buildscript/modules/mesa3d.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,8 @@

@rem Build VA-API D3D12 driver
@IF %intmesaver% GEQ 22200 set buildconf=%buildconf% -Dgallium-d3d12-video=auto
@IF /I "%d3d12%"=="y" IF %intmesaver% GEQ 22300 IF EXIST "%devroot%\libva\build\%toolchain%-%abi%\lib\pkgconfig\" set /p buildvaapi=Build Mesa3D VA-API interface (y/n):
@IF /I "%d3d12%"=="y" IF %intmesaver% GEQ 22300 IF EXIST "%devroot%\libva\build\%toolchain%-%abi%\lib\pkgconfig\" echo.
@IF /I "%d3d12%"=="y" IF %intmesaver% GEQ 22300 IF EXIST "%devroot%\libva\build\%abi%\lib\pkgconfig\" set /p buildvaapi=Build Mesa3D VA-API interface (y/n):
@IF /I "%d3d12%"=="y" IF %intmesaver% GEQ 22300 IF EXIST "%devroot%\libva\build\%abi%\lib\pkgconfig\" echo.
@IF /I "%buildvaapi%"=="y" set buildconf=%buildconf% -Dgallium-va=%mesonbooltrue%
@IF /I "%buildvaapi%"=="y" set PKG_CONFIG_LIBVA=1
@IF %intmesaver% GEQ 22200 set buildconf=%buildconf% -Dvideo-codecs=
Expand All @@ -463,7 +463,7 @@
@IF %PKG_CONFIG_LIBCLC% EQU 1 set buildconf=%buildconf% -Dstatic-libclc=all
@IF %PKG_CONFIG_LIBCLC% EQU 1 IF %toolchain%==msvc set PKG_CONFIG_PATH=%PKG_CONFIG_PATH%%llvminstloc:\=/%/clc/share/pkgconfig;
@IF %PKG_CONFIG_SPV% EQU 1 IF %toolchain%==msvc set PKG_CONFIG_PATH=%PKG_CONFIG_PATH%%llvminstloc:\=/%/spv-%abi%/lib/pkgconfig;%devroot:\=/%/spirv-tools/build/%abi%/lib/pkgconfig;
@IF %PKG_CONFIG_LIBVA% EQU 1 set PKG_CONFIG_PATH=%PKG_CONFIG_PATH%%devroot:\=/%/libva/build/%toolchain%-%abi%/lib/pkgconfig;
@IF %PKG_CONFIG_LIBVA% EQU 1 IF %toolchain%==msvc set PKG_CONFIG_PATH=%PKG_CONFIG_PATH%%devroot:\=/%/libva/build/%abi%/lib/pkgconfig;
@IF NOT defined PKG_CONFIG_PATH set PKG_CONFIG_PATH=;
@set buildconf=%buildconf% --pkg-config-path="%PKG_CONFIG_PATH:~0,-1%"
@set "PKG_CONFIG_LIBCLC="
Expand Down
2 changes: 1 addition & 1 deletion buildscript/modules/msys.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
@IF NOT EXIST "%msysloc%" set msysstate=0
@endlocal&set msysstate=%msysstate%&set msysloc=%msysloc%
@set runmsys=call "%devroot%\%projectname%\buildscript\modules\runmsys.cmd"
@set mingwpkglst={cc,clang,gdb,libclc,libelf,meson,pkgconf,python-mako,spirv-llvm-translator,vulkan-devel,zstd}
@set mingwpkglst={cc,clang,gdb,libclc,libelf,libva,meson,pkgconf,python-mako,spirv-llvm-translator,vulkan-devel,zstd}
2 changes: 2 additions & 0 deletions releasenotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
### MSVC build environment
- Update SPIRV Tools to 2023.1;
- Update pkgconf 1.9.4.
### MSYS2 build environment
- libva: Use distro package.
# 22.3.3-2
### Build environment
- MSVC: Update LLVM to 15.0.7.
Expand Down

0 comments on commit 59e6f6a

Please sign in to comment.