This repository has been archived by the owner on Jun 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
appveyor.yml
53 lines (42 loc) · 1.9 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
branches:
except:
- /dev.*/ # 不编译 dev 分支
image:
- Visual Studio 2019
platform:
- x86
configuration:
- Debug # 禁用优化 - 包括调试信息
- Release # 优化速度 - 排除调试信息
# - MinSizeRel # 优化最小二进制大小 - 排除调试信息
# - RelWithDebInfo # 优化速度 - 包括调试信息
environment:
VCPKG_ROOT: C:\tools\vcpkg\
install:
- git submodule update --init --recursive # 下载子模块
- set /p APP_ID=<app_id.txt # 如果你没有使用 app_id.txt 存放 app id,需在此手动设置
- cd %VCPKG_ROOT%
- git pull
- .\bootstrap-vcpkg.bat
- echo set(VCPKG_TARGET_ARCHITECTURE x86) > %VCPKG_ROOT%triplets\x86-windows-static.cmake
- echo set(VCPKG_CRT_LINKAGE dynamic) >> %VCPKG_ROOT%triplets\x86-windows-static.cmake
- echo set(VCPKG_LIBRARY_LINKAGE static) >> %VCPKG_ROOT%triplets\x86-windows-static.cmake
- .\vcpkg install boost-regex:x86-windows-static
- .\vcpkg install cpr:x86-windows-static
# - .\vcpkg install boost-timer:x86-windows-static
# - .\vcpkg install boost-algorithm:x86-windows-static
# - .\vcpkg install boost-format:x86-windows-static
# - .\vcpkg install boost-tokenizer:x86-windows-static
- .\vcpkg install nana:x86-windows-static
- .\vcpkg install jsoncpp:x86-windows-static
- cd %APPVEYOR_BUILD_FOLDER%
build_script:
- cmake -B build -G "Visual Studio 16 2019" -A Win32 -DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET:STRING=x86-windows-static # CMake generate
- cmake --build build --target app --config %CONFIGURATION% --clean-first --verbose # CMake build
after_build:
- dir build\%CONFIGURATION%
- copy build\%CONFIGURATION%\app.dll app.dll
- 7z a build\%CONFIGURATION%\%APP_ID%.zip app.json app.dll # 打包 app.dll 和 app.json
artifacts:
- path: build\%CONFIGURATION%\%APP_ID%.zip
name: usmooth_client_%CONFIGURATION%-v%APPVEYOR_BUILD_VERSION%