DeviceManager/WinDevice/build.bat

33 lines
576 B
Batchfile
Raw Permalink Normal View History

2024-09-26 20:06:56 +08:00
@echo on
chcp 65001
setlocal enabledelayedexpansion
set arch=x64
set build_type=Debug
rem 如果参数1不为空设置架构
if not "%~1" == "" (
set arch=%~1
)
rem 如果参数2不为空设置构建类型
if not "%~2" == "" (
set build_type=%~2
)
rem 删除旧的构建目录
if exist "build" (
rmdir "build" /s /q
)
rem 创建新的构建目录并进入
mkdir "build"
cd build
rem 运行 CMake 配置命令
cmake .. -G "Visual Studio 17 2022" -A %arch% -DCMAKE_BUILD_TYPE=%build_type%
rem 执行构建
cmake --build . --config %build_type%
endlocal