Files
video-v1/build_dav1d.bat

133 lines
4.7 KiB
Batchfile
Raw Permalink Normal View History

2025-09-19 04:42:07 +09:00
@echo off
2025-09-26 23:19:07 +09:00
echo Building dav1d static library (Release + Debug) for win64...
2025-09-19 04:42:07 +09:00
2025-09-26 23:19:07 +09:00
REM Clean previous build directories (but preserve lib\dav1d)
echo Cleaning previous build directories...
2025-09-19 04:42:07 +09:00
if exist include\dav1d rmdir /S /Q include\dav1d
2025-09-26 23:19:07 +09:00
if exist oss\dav1d\build_static_release rmdir /S /Q oss\dav1d\build_static_release
if exist oss\dav1d\build_static_debug rmdir /S /Q oss\dav1d\build_static_debug
2025-09-19 04:42:07 +09:00
REM Create output directories
echo Creating output directories...
mkdir lib\dav1d 2>nul
mkdir include\dav1d 2>nul
REM =============================================================================
2025-09-26 23:19:07 +09:00
REM Build Release version (STATIC)
2025-09-19 04:42:07 +09:00
REM =============================================================================
echo.
echo ========================================
2025-09-26 23:19:07 +09:00
echo Building RELEASE static version of dav1d...
2025-09-19 04:42:07 +09:00
echo ========================================
REM Create build directory
cd oss\dav1d
2025-09-26 23:19:07 +09:00
REM Configure with Meson (Release Static with /MD)
echo Configuring dav1d Release static build...
meson setup build_static_release --buildtype=release --default-library=static --prefix="D:/Project/video-av1/build_output/release" -Denable_tools=false -Denable_tests=false -Denable_examples=false -Db_vscrt=md
2025-09-19 04:42:07 +09:00
if %ERRORLEVEL% neq 0 (
2025-09-26 23:19:07 +09:00
echo Meson Release static configuration failed!
2025-09-19 04:42:07 +09:00
cd ..\..
exit /b 1
)
REM Build the library (Release)
2025-09-26 23:19:07 +09:00
echo Building dav1d Release static...
meson compile -C build_static_release
2025-09-19 04:42:07 +09:00
if %ERRORLEVEL% neq 0 (
2025-09-26 23:19:07 +09:00
echo Release static build failed!
2025-09-19 04:42:07 +09:00
cd ..\..
exit /b 1
)
REM =============================================================================
2025-09-26 23:19:07 +09:00
REM Build Debug version (STATIC)
2025-09-19 04:42:07 +09:00
REM =============================================================================
echo.
echo ========================================
2025-09-26 23:19:07 +09:00
echo Building DEBUG static version of dav1d...
2025-09-19 04:42:07 +09:00
echo ========================================
2025-09-26 23:19:07 +09:00
REM Configure with Meson (Debug Static with /MDd)
echo Configuring dav1d Debug static build...
meson setup build_static_debug --buildtype=debug --default-library=static --prefix="D:/Project/video-av1/build_output/debug" -Denable_tools=false -Denable_tests=false -Denable_examples=false -Db_vscrt=mdd
2025-09-19 04:42:07 +09:00
if %ERRORLEVEL% neq 0 (
2025-09-26 23:19:07 +09:00
echo Meson Debug static configuration failed!
2025-09-19 04:42:07 +09:00
cd ..\..
exit /b 1
)
REM Build the library (Debug)
2025-09-26 23:19:07 +09:00
echo Building dav1d Debug static...
meson compile -C build_static_debug
2025-09-19 04:42:07 +09:00
if %ERRORLEVEL% neq 0 (
2025-09-26 23:19:07 +09:00
echo Debug static build failed!
2025-09-19 04:42:07 +09:00
cd ..\..
exit /b 1
)
REM Go back to root directory
cd ..\..
REM =============================================================================
REM Install header files FIRST (to ensure headers are copied even if libraries fail)
REM =============================================================================
echo.
echo Installing header files...
xcopy /E /I /Y "oss\dav1d\include\dav1d\*" "include\dav1d\"
if %ERRORLEVEL% neq 0 (
echo WARNING: Failed to copy header files, but continuing...
) else (
echo Successfully copied dav1d headers
)
REM Copy generated version header
echo Copying generated version header...
2025-09-26 23:19:07 +09:00
copy "oss\dav1d\build_static_release\include\vcs_version.h" "include\dav1d\"
2025-09-19 04:42:07 +09:00
if %ERRORLEVEL% neq 0 (
echo WARNING: Failed to copy vcs_version.h, but continuing...
) else (
echo Successfully copied vcs_version.h
)
REM =============================================================================
2025-09-26 23:19:07 +09:00
REM Install static library files
2025-09-19 04:42:07 +09:00
REM =============================================================================
echo.
2025-09-26 23:19:07 +09:00
echo Installing static library files...
2025-09-19 04:42:07 +09:00
2025-09-29 02:42:26 +09:00
REM Create Windows x64 lib directory
if not exist "lib\windows-x64\dav1d" mkdir "lib\windows-x64\dav1d"
2025-09-26 23:19:07 +09:00
REM Copy Release static library files
echo Copying Release static library...
2025-09-29 02:42:26 +09:00
copy "oss\dav1d\build_static_release\src\libdav1d.a" "lib\windows-x64\dav1d\dav1d.lib"
2025-09-19 04:42:07 +09:00
if %ERRORLEVEL% neq 0 (
2025-09-26 23:19:07 +09:00
echo Failed to copy Release static library!
2025-09-19 04:42:07 +09:00
exit /b 1
)
2025-09-26 23:19:07 +09:00
echo Successfully copied Release static library: dav1d.lib
2025-09-19 04:42:07 +09:00
2025-09-26 23:19:07 +09:00
REM Copy Debug static library files (with -debug postfix)
echo Copying Debug static library...
2025-09-29 02:42:26 +09:00
copy "oss\dav1d\build_static_debug\src\libdav1d.a" "lib\windows-x64\dav1d\dav1d-debug.lib"
2025-09-19 04:42:07 +09:00
if %ERRORLEVEL% neq 0 (
2025-09-26 23:19:07 +09:00
echo Failed to copy Debug static library!
2025-09-19 04:42:07 +09:00
exit /b 1
)
2025-09-26 23:19:07 +09:00
echo Successfully copied Debug static library: dav1d-debug.lib
2025-09-19 04:42:07 +09:00
echo.
echo ========================================
2025-09-26 23:19:07 +09:00
echo dav1d static build completed successfully!
2025-09-19 04:42:07 +09:00
echo ========================================
2025-09-26 23:19:07 +09:00
echo Release Static Library:
2025-09-29 02:42:26 +09:00
echo - lib\windows-x64\dav1d\dav1d.lib (static library with /MD runtime)
2025-09-26 23:19:07 +09:00
echo Debug Static Library:
2025-09-29 02:42:26 +09:00
echo - lib\windows-x64\dav1d\dav1d-debug.lib (static library with /MDd runtime)
2025-09-19 04:42:07 +09:00
echo Headers: include\dav1d\
echo.
2025-09-26 23:19:07 +09:00
echo NOTE: Static libraries are linked directly into your executable.
echo No separate DLL files are required for distribution.
2025-09-19 04:42:07 +09:00
echo.