139 lines
4.7 KiB
Batchfile
139 lines
4.7 KiB
Batchfile
@echo off
|
|
echo Building dav1d dynamic library (Release + Debug) for win64...
|
|
|
|
REM Clean previous build
|
|
echo Cleaning previous build...
|
|
if exist lib\dav1d rmdir /S /Q lib\dav1d
|
|
if exist include\dav1d rmdir /S /Q include\dav1d
|
|
if exist oss\dav1d\build_shared_release rmdir /S /Q oss\dav1d\build_shared_release
|
|
if exist oss\dav1d\build_shared_debug rmdir /S /Q oss\dav1d\build_shared_debug
|
|
|
|
REM Create output directories
|
|
echo Creating output directories...
|
|
mkdir lib\dav1d 2>nul
|
|
mkdir include\dav1d 2>nul
|
|
|
|
REM =============================================================================
|
|
REM Build Release version (SHARED)
|
|
REM =============================================================================
|
|
echo.
|
|
echo ========================================
|
|
echo Building RELEASE shared version of dav1d...
|
|
echo ========================================
|
|
|
|
REM Create build directory
|
|
cd oss\dav1d
|
|
|
|
REM Configure with Meson (Release Shared)
|
|
echo Configuring dav1d Release shared build...
|
|
meson setup build_shared_release --buildtype=release --default-library=shared --prefix="D:/Project/video-av1/build_output/release" -Denable_tools=false -Denable_tests=false -Denable_examples=false
|
|
if %ERRORLEVEL% neq 0 (
|
|
echo Meson Release shared configuration failed!
|
|
cd ..\..
|
|
exit /b 1
|
|
)
|
|
|
|
REM Build the library (Release)
|
|
echo Building dav1d Release shared...
|
|
meson compile -C build_shared_release
|
|
if %ERRORLEVEL% neq 0 (
|
|
echo Release shared build failed!
|
|
cd ..\..
|
|
exit /b 1
|
|
)
|
|
|
|
REM =============================================================================
|
|
REM Build Debug version (SHARED)
|
|
REM =============================================================================
|
|
echo.
|
|
echo ========================================
|
|
echo Building DEBUG shared version of dav1d...
|
|
echo ========================================
|
|
|
|
REM Configure with Meson (Debug Shared)
|
|
echo Configuring dav1d Debug shared build...
|
|
meson setup build_shared_debug --buildtype=debug --default-library=shared --prefix="D:/Project/video-av1/build_output/debug" -Denable_tools=false -Denable_tests=false -Denable_examples=false
|
|
if %ERRORLEVEL% neq 0 (
|
|
echo Meson Debug shared configuration failed!
|
|
cd ..\..
|
|
exit /b 1
|
|
)
|
|
|
|
REM Build the library (Debug)
|
|
echo Building dav1d Debug shared...
|
|
meson compile -C build_shared_debug
|
|
if %ERRORLEVEL% neq 0 (
|
|
echo Debug shared build failed!
|
|
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...
|
|
copy "oss\dav1d\build_shared_release\include\vcs_version.h" "include\dav1d\"
|
|
if %ERRORLEVEL% neq 0 (
|
|
echo WARNING: Failed to copy vcs_version.h, but continuing...
|
|
) else (
|
|
echo Successfully copied vcs_version.h
|
|
)
|
|
|
|
REM =============================================================================
|
|
REM Install shared library files
|
|
REM =============================================================================
|
|
echo.
|
|
echo Installing shared library files...
|
|
|
|
REM Copy Release shared library files
|
|
echo Copying Release shared library...
|
|
copy "oss\dav1d\build_shared_release\src\libdav1d.dll.a" "lib\dav1d\dav1d.lib"
|
|
copy "oss\dav1d\build_shared_release\src\libdav1d-*.dll" "lib\dav1d\"
|
|
if %ERRORLEVEL% neq 0 (
|
|
echo Failed to copy Release shared library!
|
|
exit /b 1
|
|
)
|
|
|
|
REM Copy Debug shared library files (with -debug postfix)
|
|
echo Copying Debug shared library...
|
|
copy "oss\dav1d\build_shared_debug\src\libdav1d.dll.a" "lib\dav1d\dav1d-debug.lib"
|
|
copy "oss\dav1d\build_shared_debug\src\libdav1d-*.dll" "lib\dav1d\"
|
|
if exist "lib\dav1d\libdav1d-*.dll" (
|
|
for %%f in ("lib\dav1d\libdav1d-*.dll") do (
|
|
set filename=%%~nf
|
|
ren "%%f" "!filename!-debug.dll"
|
|
)
|
|
)
|
|
if %ERRORLEVEL% neq 0 (
|
|
echo Failed to copy Debug shared library!
|
|
exit /b 1
|
|
)
|
|
|
|
echo.
|
|
echo ========================================
|
|
echo dav1d shared build completed successfully!
|
|
echo ========================================
|
|
echo Release Shared Library:
|
|
echo - lib\dav1d\dav1d.lib (import library)
|
|
echo - lib\dav1d\libdav1d-*.dll (runtime library)
|
|
echo Debug Shared Library:
|
|
echo - lib\dav1d\dav1d-debug.lib (import library)
|
|
echo - lib\dav1d\libdav1d-*-debug.dll (runtime library)
|
|
echo Headers: include\dav1d\
|
|
echo.
|
|
echo NOTE: DLL files must be distributed with your application.
|
|
echo Place DLL files in the same directory as your executable.
|
|
echo. |