This commit is contained in:
rankun 2020-02-20 09:11:07 +08:00
commit 86690b8a06
2 changed files with 18 additions and 17 deletions

View file

@ -76,9 +76,6 @@ jobs:
env:
vc_arch: ${{ matrix.msvc_arch }}
run: |
# call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" %vc_arch%
# qmake
# nmake
call "ci\win\build_for_win.bat" release %vc_arch%
# tag 打包
- name: package

View file

@ -3,25 +3,26 @@ set vcvarsall="C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC
set qt_msvc_path="d:\a\QtScrcpy\Qt\5.12.7\"
set build_path_name="../build-win"
:: 获取脚本绝对路径
:: 获取脚本绝对路径
set script_path=%~dp0
:: 进入脚本所在目录,因为这会影响脚本中执行的程序的工作目录
:: 进入脚本所在目录,因为这会影响脚本中执行的程序的工作目录
set old_cd=%cd%
cd /d %~dp0
set build_path=%script_path%%build_path_name%
:: 启动参数声明
:: 启动参数声明
set debug_mode="false"
set cpu_mode=x86
set errno=1
echo=
echo=
echo ---------------------------------------------------------------
echo 检查编译参数[debug/release x86/x64]
echo check build param[debug/release x86/x64]
echo ---------------------------------------------------------------
:: 编译参数检查 /i忽略大小写
:: 编译参数检查 /i忽略大小写
if /i "%1"=="debug" (
set debug_mode="true"
)
@ -36,14 +37,14 @@ if /i "%2"=="x64" (
set cpu_mode=x64
)
:: 提示
:: 提示
if /i %debug_mode% == "true" (
echo 当前编译模式为 debug %cpu_mode%
echo current build mode: debug %cpu_mode%
) else (
echo 当前编译模式为debug release %cpu_mode%
echo current build mode: release %cpu_mode%
)
:: 环境变量设置
:: 环境变量设置
if /i %cpu_mode% == x86 (
set qt_msvc_path=%qt_msvc_path%msvc2017\bin
) else (
@ -52,7 +53,7 @@ if /i %cpu_mode% == x86 (
set PATH=%qt_msvc_path%;%PATH%
:: 注册vc环境
:: 注册vc环境
if /i %cpu_mode% == x86 (
call %vcvarsall% %cpu_mode%
) else (
@ -67,7 +68,7 @@ if not %errorlevel%==0 (
echo=
echo=
echo ---------------------------------------------------------------
echo 开始qmake编译
echo begin qmake build
echo ---------------------------------------------------------------
if exist %build_path% (
@ -85,7 +86,7 @@ if /i %debug_mode% == "true" (
)
:: qmake ../all.pro -spec win32-msvc "CONFIG+=debug" "CONFIG+=qml_debug"
qmake ../all.pro %qmake_params%
qmake ../../all.pro %qmake_params%
nmake
@ -97,8 +98,11 @@ if not %errorlevel%==0 (
echo=
echo=
echo ---------------------------------------------------------------
echo 完成!
echo finish!!!
echo ---------------------------------------------------------------
set errno=0
:return
cd %old_cd%
cd %old_cd%
exit /B %errno%