forked from Hishiro64/av1an-win-script
-
Notifications
You must be signed in to change notification settings - Fork 0
/
(1.3)_build.bat
100 lines (78 loc) · 2.73 KB
/
(1.3)_build.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
@echo off
TITLE Av1an Build
cls
setlocal enabledelayedexpansion
:: Set path
set "AV1=%~dp0"
:: Correct path
cd "%AV1%"
:: Set the base path variable
set PATH=%AV1%\dependencies
:: Append paths
for /D %%G in ("%AV1%\dependencies\*") do (
set PATH=!PATH!;%%G
)
:: install git from https://github.com/git-for-windows/git/releases/download/v2.43.0.windows.1/PortableGit-2.43.0-64-bit.7z.exe
set PATH=!PATH!;%AV1%\dependencies\git\bin
git clone https://github.com/microsoft/vcpkg dependencies\vcpkg 2>nul
:: Clone av1an repo
git clone https://github.com/master-of-zen/Av1an source 2>nul
cd source
git pull
cd ..
set PATH=!PATH!;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\
set PATH=!PATH!;%SYSTEMROOT%\System32
:: TODO make this dynamic
set PATH=!PATH!;"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.38.33130\bin\Hostx64\x64"
::LLVM
:: powershell.exe Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
:: powershell.exe Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
:: scoop install main/llvm
cd dependencies\vcpkg\scripts
powershell.exe -NoProfile -ExecutionPolicy Bypass -File bootstrap.ps1 >$null 2>&1
cd ..
::vcpkg update
git pull
vcpkg update
::vcpkg install
::vcpkg install ffmpeg
::setx VCPKG_ROOT %AV1%\dependencies\vcpkg
REM :: make it build debug only
REM cd triplets
REM del x64-windows-dbg.cmake
REM ECHO set(VCPKG_TARGET_ARCHITECTURE x64) >> x64-windows-dbg.cmake
REM ECHO set(VCPKG_CRT_LINKAGE dynamic) >> x64-windows-dbg.cmake
REM ECHO set(VCPKG_LIBRARY_LINKAGE dynamic) >> x64-windows-dbg.cmake
REM ECHO set(VCPKG_BUILD_TYPE debug) >> x64-windows-dbg.cmake
REM cd ..
REM vcpkg install ffmpeg:x64-windows-dbg
REM :: make it build release only
REM cd triplets
REM del x64-windows-rel.cmake
REM ECHO set(VCPKG_TARGET_ARCHITECTURE x64) >> x64-windows-rel.cmake
REM ECHO set(VCPKG_CRT_LINKAGE dynamic) >> x64-windows-rel.cmake
REM ECHO set(VCPKG_LIBRARY_LINKAGE dynamic) >> x64-windows-rel.cmake
REM ECHO set(VCPKG_BUILD_TYPE release) >> x64-windows-rel.cmake
REM cd ..
REM vcpkg install ffmpeg:x64-windows-rel
::TOFIX
:: Install pkgconfig (pkgconf)
vcpkg install pkgconf --triplet x64-windows
copy dependencies\ffmpeg-6.1.1\lib\*.lib source > NUL
copy dependencies\vcpkg\packages\pkgconf_x64-windows\lib\pkgconf.lib source > NUL
:: FFMPEG_DIR
setx FFMPEG_DIR %AV1%\dependencies\ffmpeg-6.1.1
:: Clang
setx LIBCLANG_PATH %AV1%\dependencies\clang\bin
::Copy vs libs
cd "%AV1%"
copy dependencies\vapoursynth64\sdk\lib64\VapourSynth.lib source
copy dependencies\vapoursynth64\sdk\lib64\VSScript.lib source
:: assuming rust is installed
set PATH=!PATH!;C:\Users\%username%\.cargo\bin
cd source
git pull
::cargo build
cargo build -r
copy target\release\av1an.exe ..\dependencies\av1an > NUL
pause