暂存文件
This commit is contained in:
28
scripts/build.bat
Normal file
28
scripts/build.bat
Normal file
@@ -0,0 +1,28 @@
|
||||
@echo off
|
||||
REM 构建脚本(Windows)
|
||||
|
||||
set BUILD_TYPE=%1
|
||||
if "%BUILD_TYPE%"=="" set BUILD_TYPE=Release
|
||||
|
||||
set BUILD_DIR=build-%BUILD_TYPE%
|
||||
|
||||
echo Building DisplayFlow in %BUILD_TYPE% mode...
|
||||
|
||||
REM 创建构建目录
|
||||
if not exist "%BUILD_DIR%" mkdir "%BUILD_DIR%"
|
||||
cd "%BUILD_DIR%"
|
||||
|
||||
REM 配置 CMake
|
||||
cmake .. ^
|
||||
-G "Visual Studio 16 2019" -A x64 ^
|
||||
-DCMAKE_BUILD_TYPE=%BUILD_TYPE% ^
|
||||
-DBUILD_TESTS=ON ^
|
||||
-DENABLE_VP8_CODEC=OFF
|
||||
|
||||
REM 编译
|
||||
cmake --build . --config %BUILD_TYPE% --parallel
|
||||
|
||||
echo Build complete! Output in %BUILD_DIR%\
|
||||
|
||||
|
||||
|
||||
27
scripts/build.sh
Normal file
27
scripts/build.sh
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
# 构建脚本(Linux/macOS)
|
||||
|
||||
set -e
|
||||
|
||||
BUILD_TYPE=${1:-Release}
|
||||
BUILD_DIR="build-${BUILD_TYPE,,}"
|
||||
|
||||
echo "Building DisplayFlow in $BUILD_TYPE mode..."
|
||||
|
||||
# 创建构建目录
|
||||
mkdir -p "$BUILD_DIR"
|
||||
cd "$BUILD_DIR"
|
||||
|
||||
# 配置 CMake
|
||||
cmake .. \
|
||||
-DCMAKE_BUILD_TYPE="$BUILD_TYPE" \
|
||||
-DBUILD_TESTS=ON \
|
||||
-DENABLE_VP8_CODEC=OFF
|
||||
|
||||
# 编译
|
||||
cmake --build . --config "$BUILD_TYPE" -j$(nproc)
|
||||
|
||||
echo "Build complete! Output in $BUILD_DIR/"
|
||||
|
||||
|
||||
|
||||
27
scripts/setup_dependencies.bat
Normal file
27
scripts/setup_dependencies.bat
Normal file
@@ -0,0 +1,27 @@
|
||||
@echo off
|
||||
REM 依赖安装脚本(Windows)
|
||||
|
||||
echo Setting up DisplayFlow dependencies...
|
||||
|
||||
REM 检查 CMake 版本
|
||||
cmake --version
|
||||
if errorlevel 1 (
|
||||
echo Error: CMake is not installed or not in PATH
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
REM 检查是否使用 vcpkg
|
||||
if exist "vcpkg" (
|
||||
echo Using vcpkg for dependency management
|
||||
call vcpkg\bootstrap-vcpkg.bat
|
||||
vcpkg\vcpkg.exe install flatbuffers:x64-windows
|
||||
echo Dependencies installed via vcpkg
|
||||
) else (
|
||||
echo Dependencies will be fetched via CMake FetchContent
|
||||
echo No manual installation required
|
||||
)
|
||||
|
||||
echo Dependency setup complete!
|
||||
|
||||
|
||||
|
||||
26
scripts/setup_dependencies.sh
Normal file
26
scripts/setup_dependencies.sh
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
# 依赖安装脚本(Linux/macOS)
|
||||
|
||||
set -e
|
||||
|
||||
echo "Setting up DisplayFlow dependencies..."
|
||||
|
||||
# 检查 CMake 版本
|
||||
CMAKE_VERSION=$(cmake --version | head -n1 | cut -d' ' -f3)
|
||||
echo "CMake version: $CMAKE_VERSION"
|
||||
|
||||
# 检查是否使用 vcpkg
|
||||
if [ -d "vcpkg" ]; then
|
||||
echo "Using vcpkg for dependency management"
|
||||
./vcpkg/bootstrap-vcpkg.sh
|
||||
./vcpkg/vcpkg install flatbuffers
|
||||
echo "Dependencies installed via vcpkg"
|
||||
else
|
||||
echo "Dependencies will be fetched via CMake FetchContent"
|
||||
echo "No manual installation required"
|
||||
fi
|
||||
|
||||
echo "Dependency setup complete!"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user