-
Notifications
You must be signed in to change notification settings - Fork 5
/
.appveyor.yml
195 lines (158 loc) · 7.57 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# Notes:
# - Minimal appveyor.yml file is an empty file. All sections are optional.
# - Indent each level of configuration with 2 spaces. Do not use tabs!
# - All section names are case-sensitive.
# - Section names should be unique on each level.
#---------------------------------#
# general configuration #
#---------------------------------#
# version format
version: '{branch}-{build}'
# Do not build on tags (GitHub only)
skip_tags: true
# manual mode
branches:
except:
- /.*/
#---------------------------------#
# environment configuration #
#---------------------------------#
# environment variables
# build system info: https://www.appveyor.com/docs/windows-images-software/
os: Visual Studio 2022
environment:
REPO_DIR: &REPO_DIR c:\project # directory created by appveyor
CMAKE_GENERATOR_X86: -G "Visual Studio 17 2022" -A "Win32"
CMAKE_GENERATOR_X64: -G "Visual Studio 17 2022" -A "x64"
CMAKE_COMMON_DEFINES: -DCMAKE_TOOLCHAIN_FILE="%REPO_DIR%\src\msvc_flags.cmake"
OGG_SOL_FILE: ogg.sln
OGG_MSBUILD_CMD_X86: /maxcpucount /property:Configuration=Release,Platform=Win32 /target:ogg
OGG_MSBUILD_CMD_X64: /maxcpucount /property:Configuration=Release,Platform=x64 /target:ogg
OPUS_SOL_FILE: Opus.sln
OPUS_GIT_TAG: v1.5.2
OPUS_CMAKE: -DOPUS_BUILD_PROGRAMS=ON -DOPUS_DEEP_PLC=ON -DOPUS_DRED=ON -DOPUS_OSCE=ON -DOPUS_STATIC_RUNTIME=ON
OPUS_MSBUILD_CMD_X86: /maxcpucount /property:Configuration=Release,Platform=Win32
OPUS_MSBUILD_CMD_X64: /maxcpucount /property:Configuration=Release,Platform=x64
LIBOPUSENC_SOL_FILE: opusenc.sln
LIBOPUSENC_MSBUILD_CMD_X86: /maxcpucount /property:Configuration=Release,Platform=Win32
LIBOPUSENC_MSBUILD_CMD_X64: /maxcpucount /property:Configuration=Release,Platform=x64
OPENSSL32_BIN_URL: https://github.com/Chocobo1/openssl_win32-build/releases/download/2020.06.25_10/openssl-1.0.2u-32.exe
OPENSSL64_BIN_URL: https://github.com/Chocobo1/openssl_win32-build/releases/download/2020.06.25_10/openssl-1.0.2u-64.exe
OPUSFILE_SOL_FILE: opusfile.sln
OPUSFILE_MSBUILD_CMD_X86: /maxcpucount /property:Configuration=Release-NoHTTP,Platform=Win32 /target:opusfile
OPUSFILE_MSBUILD_CMD_X64: /maxcpucount /property:Configuration=Release-NoHTTP,Platform=x64 /target:opusfile
NASM_URL: https://www.nasm.us/pub/nasm/releasebuilds/2.16.01/win64/nasm-2.16.01-win64.zip
FLAC_SOL_FILE: src\libFLAC++\FLAC++.vcxproj
FLAC_CMAKE_X86: -DOGG_INCLUDE_DIR="%REPO_DIR%\lib\libogg\include" -DOGG_LIBRARY="%REPO_DIR%\lib\libogg\_build\Win32\Release\ogg.lib" -DINSTALL_MANPAGES=OFF
FLAC_CMAKE_X64: -DOGG_INCLUDE_DIR="%REPO_DIR%\lib\libogg\include" -DOGG_LIBRARY="%REPO_DIR%\lib\libogg\_build\x64\Release\ogg.lib" -DINSTALL_MANPAGES=OFF
FLAC_MSBUILD_CMD_X86: /maxcpucount /property:Configuration=Release,Platform=Win32
FLAC_MSBUILD_CMD_X64: /maxcpucount /property:Configuration=Release,Platform=x64
OPUS-TOOLS_SOL_FILE: opus-tools.sln
OPUS-TOOLS_MSBUILD_CMD_X86: /maxcpucount /property:Configuration=Release,Platform=Win32
OPUS-TOOLS_MSBUILD_CMD_X64: /maxcpucount /property:Configuration=Release,Platform=x64
# clone directory
clone_folder: *REPO_DIR
#---------------------------------#
# build configuration #
#---------------------------------#
# scripts to run before build
before_build:
# git submodules
- cd "%REPO_DIR%"
- git submodule update --init --remote --recursive
# prepare ogg
- cd "%REPO_DIR%\lib\libogg"
- mkdir "_build" && cd "_build"
- mkdir "Win32" && cd "Win32"
- cmake %CMAKE_GENERATOR_X86% %CMAKE_COMMON_DEFINES% ..\..\
- msbuild %OGG_SOL_FILE% %OGG_MSBUILD_CMD_X86%
- cd ..
- mkdir "x64" && cd "x64"
- cmake %CMAKE_GENERATOR_X64% %CMAKE_COMMON_DEFINES% ..\..\
- msbuild %OGG_SOL_FILE% %OGG_MSBUILD_CMD_X64%
- cd ..
# prepare opus
- cd "%REPO_DIR%\lib\opus"
- git checkout tags/%OPUS_GIT_TAG%
- autogen.bat
- mkdir "_build" && cd "_build"
- mkdir "Win32" && cd "Win32"
- cmake %CMAKE_GENERATOR_X86% %CMAKE_COMMON_DEFINES% %OPUS_CMAKE% ..\..\
- msbuild %OPUS_SOL_FILE% %OPUS_MSBUILD_CMD_X86%
- cd ..
- mkdir "x64" && cd "x64"
- cmake %CMAKE_GENERATOR_X64% %CMAKE_COMMON_DEFINES% %OPUS_CMAKE% ..\..\
- msbuild %OPUS_SOL_FILE% %OPUS_MSBUILD_CMD_X64%
- cd ..
# prepare libopusenc
- cd "%REPO_DIR%"
- if exist "lib\libopusenc\win32\VS2015" (rd /S /Q "lib\libopusenc\win32\VS2015")
- move /Y "src\libopusenc\VS2015" "lib\libopusenc\win32"
- msbuild "lib\libopusenc\win32\VS2015\%LIBOPUSENC_SOL_FILE%" %LIBOPUSENC_MSBUILD_CMD_X86%
- msbuild "lib\libopusenc\win32\VS2015\%LIBOPUSENC_SOL_FILE%" %LIBOPUSENC_MSBUILD_CMD_X64%
# prepare openssl
- cd "%REPO_DIR%\lib"
- mkdir "openssl" && cd "openssl"
- appveyor DownloadFile "%OPENSSL32_BIN_URL%" -FileName "openssl32.exe"
- 7z x "openssl32.exe" -oWin32 > nul
- appveyor DownloadFile "%OPENSSL64_BIN_URL%" -FileName "openssl64.exe"
- 7z x "openssl64.exe" -ox64 > nul
# prepare opusfile
- cd "%REPO_DIR%"
- if exist "lib\opusfile\win32\VS2015" (rd /S /Q "lib\opusfile\win32\VS2015")
- move /Y "src\opusfile\VS2015" "lib\opusfile\win32"
- msbuild "lib\opusfile\win32\VS2015\%OPUSFILE_SOL_FILE%" %OPUSFILE_MSBUILD_CMD_X86%
- msbuild "lib\opusfile\win32\VS2015\%OPUSFILE_SOL_FILE%" %OPUSFILE_MSBUILD_CMD_X64%
# install NASM
- cd \
- appveyor DownloadFile "%NASM_URL%" -FileName "c:\nasm.zip"
- 7z x "nasm.zip" > nul
- move nasm-* NASM
- set PATH=%PATH%;c:\NASM;
- nasm -v
# prepare flac
- cd "%REPO_DIR%\lib\flac"
- mkdir "_build" && cd "_build"
- mkdir "Win32" && cd "Win32"
- cmake %CMAKE_GENERATOR_X86% %CMAKE_COMMON_DEFINES% %FLAC_CMAKE_X86% ..\..\
- msbuild %FLAC_SOL_FILE% %FLAC_MSBUILD_CMD_X86%
- cd ..
- mkdir "x64" && cd "x64"
- cmake %CMAKE_GENERATOR_X64% %CMAKE_COMMON_DEFINES% %FLAC_CMAKE_X64% ..\..\
- msbuild %FLAC_SOL_FILE% %FLAC_MSBUILD_CMD_X64%
- cd ..
# to run your custom scripts instead of automatic MSBuild
build_script:
- cd "%REPO_DIR%"
- if exist "lib\opus-tools\win32\VS2015" (rd /S /Q "lib\opus-tools\win32\VS2015")
- move /Y "src\opus-tools\VS2015" "lib\opus-tools\win32\VS2015"
- ps: (Get-Content 'lib\opus-tools\win32\config.h') | ForEach-Object { $_ -replace 'libFLAC_static.lib', 'FLAC++.lib' } | Set-Content 'lib\opus-tools\win32\config.h'
- msbuild "lib\opus-tools\win32\VS2015\%OPUS-TOOLS_SOL_FILE%" %OPUS-TOOLS_MSBUILD_CMD_X86%
#- mkdir "lib\opus-tools\win32\VS2015\x64\Release"
#- copy "src\opus-tools\opusenc.pgd" "lib\opus-tools\win32\VS2015\x64\Release\"
- msbuild "lib\opus-tools\win32\VS2015\%OPUS-TOOLS_SOL_FILE%" %OPUS-TOOLS_MSBUILD_CMD_X64%
# scripts to run before deployment
after_build:
# prepare for artifacts packaging
- cd "%REPO_DIR%"
- mkdir "opus-tools\win32" "opus-tools\x64"
- copy "Readme.md" "opus-tools"
- copy "lib\opus\_build\Win32\Release\opus_*.exe" "opus-tools\win32"
- copy "lib\opus-tools\win32\VS2015\Win32\Release\opus*.exe" "opus-tools\win32"
- copy "lib\opus\_build\x64\Release\opus_*.exe" "opus-tools\x64"
- copy "lib\opus-tools\win32\VS2015\x64\Release\opus*.exe" "opus-tools\x64"
- 7z a -sfx7z.sfx -mx9 "opus-tools.exe" "opus-tools" # the artifact must reside at the source repo root
- 'powershell -Command "& { $hash = (Get-FileHash -Algorithm SHA256 "opus-tools.exe").hash.ToString().toLower(); Write-Host $hash " *opus-tools.exe"; }" > "opus-tools.exe.sha256"'
#---------------------------------#
# tests configuration #
#---------------------------------#
# to disable automatic tests
test: off
#---------------------------------#
# artifacts configuration #
#---------------------------------#
artifacts:
- path: opus-tools.exe
name: exe
- path: opus-tools.exe.sha256
name: checksum