Bat腳本編譯vs工程

 

@echo 初始化環境
@set OldPath=%cd%
::x86_amd64的路徑要自己找
 
@cd /d D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64
@if not %errorlevel% == 0 goto :end
call vcvarsx86_amd64.bat
@if not %errorlevel% == 0 goto :end
cd /d %OldPath%
@if not %errorlevel% == 0 goto :end

@echo 清理項目
devenv ./XXXXXX.sln /Clean
@if not %errorlevel% == 0 goto :errBuild

@echo 開始編譯
devenv ./XXXXXX.sln /ReBuild "Debug|x64"
@if not %errorlevel% == 0 goto :errBuild
devenv ./XXXXXX.sln /ReBuild "Release|x64"
@if not %errorlevel% == 0 goto :errBuild

@rem 頭文件
::如果需要拷貝文件就看下copy命令
::如果需要刪除文件就看下del命令
@echo 同步完成
@pause

goto :end
@pause
:errBuild
@echo 編譯項目出錯
@pause
:end

cl命令編譯

VS項目批量編譯,Bat腳本實現

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章