149 lines
5.0 KiB
Batchfile
149 lines
5.0 KiB
Batchfile
@echo off
|
|
echo Building libwebm static library (Release + Debug) for win64...
|
|
|
|
REM Clean previous build
|
|
echo Cleaning previous build...
|
|
if exist lib\windows-x64\libwebm rmdir /S /Q lib\windows-x64\libwebm
|
|
if exist include\libwebm rmdir /S /Q include\libwebm
|
|
if exist oss\libwebm\build_win64 rmdir /S /Q oss\libwebm\build_win64
|
|
if exist oss\libwebm\build_debug rmdir /S /Q oss\libwebm\build_debug
|
|
|
|
REM Create output directories
|
|
echo Creating output directories...
|
|
mkdir lib\windows-x64\libwebm 2>nul
|
|
mkdir include\libwebm 2>nul
|
|
|
|
REM =============================================================================
|
|
REM Build Release version (STATIC)
|
|
REM =============================================================================
|
|
echo.
|
|
echo ========================================
|
|
echo Building RELEASE static version of libwebm...
|
|
echo ========================================
|
|
|
|
REM Create build directory
|
|
cd oss\libwebm
|
|
mkdir build_win64 2>nul
|
|
cd build_win64
|
|
|
|
REM Configure with CMake (Release Static)
|
|
echo Configuring libwebm Release static build...
|
|
cmake -G "Visual Studio 17 2022" -A x64 -DBUILD_SHARED_LIBS=OFF -DENABLE_TESTS=OFF -DENABLE_SAMPLE_PROGRAMS=OFF -DCMAKE_INSTALL_PREFIX="D:/Project/video-av1" ..
|
|
if %ERRORLEVEL% neq 0 (
|
|
echo CMake Release static configuration failed!
|
|
cd ..\..\..
|
|
exit /b 1
|
|
)
|
|
|
|
REM Build the library (Release)
|
|
echo Building libwebm Release static...
|
|
cmake --build . --config Release
|
|
if %ERRORLEVEL% neq 0 (
|
|
echo Release static build failed!
|
|
cd ..\..\..
|
|
exit /b 1
|
|
)
|
|
|
|
REM Go back to libwebm source directory
|
|
cd ..
|
|
|
|
REM =============================================================================
|
|
REM Build Debug version (STATIC)
|
|
REM =============================================================================
|
|
echo.
|
|
echo ========================================
|
|
echo Building DEBUG static version of libwebm...
|
|
echo ========================================
|
|
|
|
REM Create debug build directory
|
|
mkdir build_debug 2>nul
|
|
cd build_debug
|
|
|
|
REM Configure with CMake (Debug Static)
|
|
echo Configuring libwebm Debug static build...
|
|
cmake -G "Visual Studio 17 2022" -A x64 -DBUILD_SHARED_LIBS=OFF -DENABLE_TESTS=OFF -DENABLE_SAMPLE_PROGRAMS=OFF ..
|
|
if %ERRORLEVEL% neq 0 (
|
|
echo CMake Debug static configuration failed!
|
|
cd ..\..\..
|
|
exit /b 1
|
|
)
|
|
|
|
REM Build the library (Debug)
|
|
echo Building libwebm Debug static...
|
|
cmake --build . --config Debug
|
|
if %ERRORLEVEL% neq 0 (
|
|
echo Debug static build failed!
|
|
cd ..\..\..
|
|
exit /b 1
|
|
)
|
|
|
|
REM Rename debug library immediately after build
|
|
echo Renaming debug library...
|
|
if exist Debug\webm.lib (
|
|
ren Debug\webm.lib webm-debug.lib
|
|
echo Renamed webm.lib to webm-debug.lib
|
|
) else (
|
|
echo WARNING: webm.lib not found in debug build!
|
|
)
|
|
|
|
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...
|
|
for %%f in (oss\libwebm\*.hpp) do (
|
|
copy "%%f" "include\libwebm\" >nul 2>&1
|
|
)
|
|
echo Copied root header files
|
|
|
|
xcopy /E /I /Y /Q "oss\libwebm\mkvmuxer\*.h" "include\libwebm\mkvmuxer\" >nul 2>&1
|
|
xcopy /E /I /Y /Q "oss\libwebm\mkvmuxer\*.hpp" "include\libwebm\mkvmuxer\" >nul 2>&1
|
|
echo Successfully copied mkvmuxer headers
|
|
|
|
xcopy /E /I /Y /Q "oss\libwebm\mkvparser\*.h" "include\libwebm\mkvparser\" >nul 2>&1
|
|
xcopy /E /I /Y /Q "oss\libwebm\mkvparser\*.hpp" "include\libwebm\mkvparser\" >nul 2>&1
|
|
echo Successfully copied mkvparser headers
|
|
|
|
xcopy /E /I /Y /Q "oss\libwebm\common\*.h" "include\libwebm\common\" >nul 2>&1
|
|
xcopy /E /I /Y /Q "oss\libwebm\common\*.hpp" "include\libwebm\common\" >nul 2>&1
|
|
echo Successfully copied common headers
|
|
|
|
xcopy /E /I /Y /Q "oss\libwebm\webvtt\*.h" "include\libwebm\webvtt\" >nul 2>&1
|
|
xcopy /E /I /Y /Q "oss\libwebm\webvtt\*.hpp" "include\libwebm\webvtt\" >nul 2>&1
|
|
echo Successfully copied webvtt headers
|
|
|
|
REM =============================================================================
|
|
REM Install static library files
|
|
REM =============================================================================
|
|
echo.
|
|
echo Installing static library files...
|
|
|
|
REM Copy Release static library files
|
|
echo Copying Release static library...
|
|
copy "oss\libwebm\build_win64\Release\webm.lib" "lib\windows-x64\libwebm\"
|
|
if %ERRORLEVEL% neq 0 (
|
|
echo Failed to copy Release static library!
|
|
exit /b 1
|
|
)
|
|
|
|
REM Copy Debug static library files (already renamed)
|
|
echo Copying Debug static library...
|
|
copy "oss\libwebm\build_debug\Debug\webm-debug.lib" "lib\windows-x64\libwebm\"
|
|
if %ERRORLEVEL% neq 0 (
|
|
echo Failed to copy Debug static library!
|
|
exit /b 1
|
|
)
|
|
|
|
echo.
|
|
echo ========================================
|
|
echo libwebm static build completed successfully!
|
|
echo ========================================
|
|
echo Release Static Library:
|
|
echo - lib\windows-x64\libwebm\webm.lib
|
|
echo Debug Static Library:
|
|
echo - lib\windows-x64\libwebm\webm-debug.lib
|
|
echo Headers: include\libwebm\
|
|
echo. |