-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.appveyor.yml
147 lines (117 loc) · 5.41 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
# 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
NASM_URL: https://www.nasm.us/pub/nasm/releasebuilds/2.16.03/win64/nasm-2.16.03-win64.zip
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
VORBIS_SOL_FILE: vorbis_static.sln
VORBIS_MSBUILD_CMD_X86: /maxcpucount /property:Configuration=Release,Platform=Win32 /target:libvorbisfile
VORBIS_MSBUILD_CMD_X64: /maxcpucount /property:Configuration=Release,Platform=x64 /target:libvorbisfile
FLAC_SOL_FILE: src\libFLAC++\FLAC++.vcxproj
FLAC_CMAKE_X86: -DINSTALL_MANPAGES=OFF -DOGG_INCLUDE_DIR="%REPO_DIR%\lib\ogg\include" -DOGG_LIBRARY="%REPO_DIR%\lib\ogg\_build\Win32\Release\ogg.lib"
FLAC_CMAKE_X64: -DINSTALL_MANPAGES=OFF -DOGG_INCLUDE_DIR="%REPO_DIR%\lib\ogg\include" -DOGG_LIBRARY="%REPO_DIR%\lib\ogg\_build\x64\Release\ogg.lib"
FLAC_MSBUILD_CMD_X86: /maxcpucount /property:Configuration=Release,Platform=Win32
FLAC_MSBUILD_CMD_X64: /maxcpucount /property:Configuration=Release,Platform=x64
VORBIS-TOOLS_SOL_FILE: vorbis-tools.sln
VORBIS-TOOLS_MSBUILD_CMD_X86: /maxcpucount /property:Configuration=Release,Platform=Win32
VORBIS-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, https does not support `--depth 1` :(
- cd "%REPO_DIR%"
- git submodule update --init --remote --recursive
# 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 ogg
- cd "%REPO_DIR%\lib\ogg"
- 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 vorbis
- cd "%REPO_DIR%"
- if exist "lib\vorbis\win32\VS2017" (rd /S /Q "lib\vorbis\win32\VS2017")
- move /Y "src\vorbis\VS2017" "lib\vorbis\win32"
- msbuild "lib\vorbis\win32\VS2017\%VORBIS_SOL_FILE%" %VORBIS_MSBUILD_CMD_X86%
- msbuild "lib\vorbis\win32\VS2017\%VORBIS_SOL_FILE%" %VORBIS_MSBUILD_CMD_X64%
# 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%"
- ps: (Get-Content 'lib\vorbis-tools\share\picture.c') | ForEach-Object { $_ -replace 'flac_picture_parse_eat\(void \*data', 'flac_picture_parse_eat(char *data' } | Set-Content 'lib\vorbis-tools\share\picture.c'
- if exist "lib\vorbis-tools\win32\VS2017" (rd /S /Q "lib\vorbis-tools\win32\VS2017")
- move /Y "src\vorbis-tools\VS2017" "lib\vorbis-tools\win32"
- msbuild "lib\vorbis-tools\win32\VS2017\%VORBIS-TOOLS_SOL_FILE%" %VORBIS-TOOLS_MSBUILD_CMD_X86%
- msbuild "lib\vorbis-tools\win32\VS2017\%VORBIS-TOOLS_SOL_FILE%" %VORBIS-TOOLS_MSBUILD_CMD_X64%
# scripts to run before deployment
after_build:
# prepare for artifacts packaging
- 'cd "%REPO_DIR%"'
- 'mkdir "win32" "x64"'
- 'copy "lib\vorbis-tools\win32\VS2017\Release\*.exe" "win32"'
- 'copy "lib\vorbis-tools\win32\VS2017\x64\Release\*.exe" "x64"'
- '7z a -mx9 "vorbis-tools.7z" "Readme.md" "win32" "x64"' # the artifact must reside at the source repo root
- 'powershell -Command "& { $hash = (Get-FileHash -Algorithm SHA256 "vorbis-tools.7z").hash.ToString().toLower(); Write-Host $hash " *vorbis-tools.7z"; }" > "vorbis-tools.7z.sha256"'
#---------------------------------#
# tests configuration #
#---------------------------------#
# to disable automatic tests
test: off
#---------------------------------#
# artifacts configuration #
#---------------------------------#
artifacts:
- path: vorbis-tools.7z
name: exe
- path: vorbis-tools.7z.sha256
name: checksum