forked from obsproject/obs-studio
-
Notifications
You must be signed in to change notification settings - Fork 2
/
appveyor.yml
177 lines (164 loc) · 9.59 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
#VS2017 15.9.4 (bump this to force clean vcpkg cache)
version: '{build}'
skip_tags: true
skip_commits:
files:
- Change.txt
- '*.rst'
- .travis.yml
- 'docs/*'
- '.*'
image: Visual Studio 2022
init:
- ps: if (0) { iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) } #rdp debug
environment:
# use the same version as official OBS
CMAKE_SYSTEM_VERSION: 10.0.18363.657
WINDOWS_CEF_BUILD_VERSION: 4638
vc_inc_arch: AVX2
# D3D12_HOOK: false
APPVEYOR_YML_DISABLE_PS_LINUX: true
# TWITCH-CLIENTID:
# secure: D3vFGk41HZaJWAZu5slwAHZhB868mGI2aIMS03L2rt4=
# TWITCH-HASH:
# secure: IRP5JLwBmPMjA7ADbZu6x2u4thqeEF9HaU1xolhaj74=
# MIXER-CLIENTID:
# secure: lQXRRvkeZDVSTUcSaR/kthiKu89K18IubKN913PC0ldjHBQ6sWa8a/t4i1f441N3RPfzAbTrXf2ijRCYYub2Qw==
# MIXER-HASH:
# secure: fIxeDxHkiNodwPeNGX+E9tSpyjg/XuT+U9N+jtpT7xU=
matrix:
- favor_arch: AMD64
- favor_arch: INTEL64
cl_cpu_options: -QIntel-jcc-erratum
VCPKG_CPU_C_FLAGS: /QIntel-jcc-erratum
- favor_arch: AMD64
vc_inc_arch: SSE2
- favor_arch: INTEL64
cl_cpu_options: -QIntel-jcc-erratum
VCPKG_CPU_C_FLAGS: /QIntel-jcc-erratum
vc_inc_arch: SSE2
# setting rdp passoword never works
# APPVEYOR_RDP_PASSWORD:
# secure: K6XkhLVN7PZDnWWtrTKYneDPMS7FgBFYYe1xuU2s8js=
matrix:
fast_finish: true
install:
# install until CI update
# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/craftwar/CI_test/master/script/install_winsdk.ps1')) #install windows sdk
# - cmd
# cmd related hack or variable is not set
# by - if "%vc_inc_arch%"=="SSE2" C:\projects\obs-studio-craftwar\CI\craftwar\submodule.cmd else C:\projects\obs-studio\CI\craftwar\submodule.cmd
- copy C:\projects\obs-studio\CI\craftwar\submodule.cmd C:\projects\
- if "%vc_inc_arch%"=="SSE2" cd .. && mv obs-studio obs-studio-craftwar && mkdir obs-studio && cd obs-studio
- C:\projects\submodule.cmd
# - if "%vc_inc_arch%"=="SSE2" C:\projects\obs-studio-craftwar\CI\craftwar\submodule.cmd else C:\projects\obs-studio\CI\craftwar\submodule.cmd
- if "%vc_inc_arch%"=="SSE2" powershell.exe -ExecutionPolicy Bypass -file C:\projects\obs-studio-craftwar\CI\craftwar\patch_SSE2build.ps1
- git fetch --tags --prune https://github.com/obsproject/obs-studio.git # get tags from official obs
- if exist dependencies2019.zip (curl -kLO https://cdn-fastly.obsproject.com/downloads/dependencies2019.zip -f --retry 5 -z dependencies2019.zip) else (curl -kLO https://cdn-fastly.obsproject.com/downloads/dependencies2019.zip -f --retry 5 -C -)
#- set VCdeps_url=https://ci.appveyor.com/api/projects/craftwar_appveyor/obs-deps/artifacts/VCdeps-blend.7z?job=Environment%3A%20favor_arch%3D%favor_arch%
- set VCdeps_file=VCdeps-%favor_arch%-%vc_inc_arch%.7z
- set VCdeps_url=https://github.com/craftwar/obs-deps/releases/download/git/%VCdeps_file%
- if exist %VCdeps_file% (curl -kLo %VCdeps_file% %VCdeps_url% -f --retry 5 -z %VCdeps_file%) else (curl -kLo %VCdeps_file% %VCdeps_url% -f --retry 5 -C -)
# for 32bit cmake run
- 7z x dependencies2019.zip -oold_dep
- 7z x %VCdeps_file% -odependencies2019
# update nvenc related headers
- move /Y dependencies2019\Win64\include\ffnvcodec\*.h "C:\projects\\%APPVEYOR_PROJECT_NAME%\plugins\obs-ffmpeg"
- set DepsPath32=%CD%\old_dep\win32
- set DepsPath64=%CD%\dependencies2019\win64
# - set curlPath=%APPVEYOR_BUILD_FOLDER%\old_dep\win64\include\
# latest
- set QT_VERSION=5.15
- set QTDIR32=C:\Qt\%QT_VERSION%\msvc2019
- set QTDIR64=C:\Qt\%QT_VERSION%\msvc2019_64
- set build_config=Release
# -Zc:inline is disabled when -GL is on
- set cl_options=-MP -Oi -arch:%vc_inc_arch% -Gw -Gy -GL -GS- -Qspectre- -favor:%favor_arch% -Zc:__cplusplus %cl_cpu_options%
# try to fix
#LINK : fatal error C1001: Internal compiler error.
#fatal error LNK1000: Internal error during IMAGE::Pass1
# - set cl_options=-MP -Oi -arch:%vc_inc_arch% -Gw -Gy -GS- -Qspectre- -favor:%favor_arch% -Zc:__cplusplus %cl_cpu_options%
#vcpkg
# update vcpkg when workaround is required
# - cd C:\tools\vcpkg
# - git checkout 2020.04 && .\bootstrap-vcpkg.bat
# - git pull && .\bootstrap-vcpkg.bat
- cd %APPVEYOR_BUILD_FOLDER%
- vcpkg remove --outdated --recurse
# /MP /Oi is default in vcpkg
- set VCPKG_CMAKE_SYSTEM_VERSION=%CMAKE_SYSTEM_VERSION%
- set VCPKG_LINKER_FLAGS=/LTCG
- set VCPKG_C_FLAGS=/arch:%vc_inc_arch% /Gw /Gy /GL /GS- /favor:%favor_arch% %VCPKG_CPU_C_FLAGS%
- set VCPKG_CXX_FLAGS=%VCPKG_C_FLAGS%
- '"C:\Program Files\Git\usr\bin\sed.exe" -i "s/CRT_LINKAGE static/CRT_LINKAGE dynamic/" /c/tools/vcpkg/triplets/x64-windows-static.cmake' #patch to dynamic crt
- echo set(VCPKG_BUILD_TYPE release) >> C:\tools\vcpkg\triplets\x64-windows-static.cmake
- if NOT "%vc_inc_arch%"=="SSE2" vcpkg install jansson:x64-windows-static
- vcpkg install zlib:x64-windows
- copy /Y dependencies2019\win64\lib\zlib.lib C:\tools\vcpkg\installed\x64-windows\lib\
- copy /Y dependencies2019\win64\bin\zlib.dll C:\tools\vcpkg\installed\x64-windows\bin\
- copy /Y dependencies2019\win64\include\z* C:\tools\vcpkg\installed\x64-windows\include\
# - echo set(VCPKG_BUILD_TYPE release) >> C:\tools\vcpkg\triplets\x64-windows.cmake # bug curl can't build
- vcpkg install curl[core,winssl]:x64-windows
- set curlPath=C:\tools\vcpkg\installed\x64-windows\include
# Detours for graphics-hook, installed from obs-deps
# - vcpkg install detours:x64-windows detours:x86-windows
# # - set detoursPath=C:\tools\vcpkg\installed\x64-windows\include\detours
# - copy /Y C:\tools\vcpkg\installed\x86-windows\include\detours\detours.h %DepsPath32%\include\detours.h
# - copy /Y C:\tools\vcpkg\installed\x86-windows\lib\detours.lib %DepsPath32%\bin\detours.lib
# - copy /Y C:\tools\vcpkg\installed\x64-windows\include\detours\detours.h %DepsPath64%\include\detours.h
# - copy /Y C:\tools\vcpkg\installed\x64-windows\lib\detours.lib %DepsPath64%\bin\detours.lib
# mbedtls
- if "%vc_inc_arch%"=="SSE2" vcpkg install mbedtls:x64-windows
# mbedtls use these 3 paths
- set mbedtlsPath=C:\Tools\vcpkg\installed\x64-windows\include
- set mbedx509Path=C:\Tools\vcpkg\installed\x64-windows\include
- set mbedcryptoPath=C:\Tools\vcpkg\installed\x64-windows\include
- set vulkanPath=%APPVEYOR_BUILD_FOLDER%\old_dep\win64\include\
# - set rnnoisePath=%APPVEYOR_BUILD_FOLDER%\old_dep\win64\include\
build_script:
- mkdir build build32 build64
- cd ./build64
# - cmake -E env CFLAGS="%cl_options%" CXXFLAGS="%cl_options%" LDFLAGS="-LTCG" cmake -G "Visual Studio 15 2017 Win64" -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_TOOLCHAIN_FILE=C:\Tools\vcpkg\scripts\buildsystems\vcpkg.cmake -DCMAKE_EXE_LINKER_FLAGS_INIT=/LTCG -DCMAKE_SHARED_LINKER_FLAGS_INIT=/LTCG -DCMAKE_STATIC_LINKER_FLAGS_INIT=/LTCG -DCMAKE_MODULE_LINKER_FLAGS_INIT=/LTCG -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true -DBUILD_CAPTIONS=true -DCOMPILE_D3D12_HOOK=false -DENABLE_SCRIPTING=false ..
- C:\projects\obs-studio\CI\craftwar\cmake_64bit.cmd
- call msbuild /m /p:Configuration=%build_config% C:\projects\obs-studio\build64\obs-studio.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- cd ../build32
- cmake -E env CFLAGS="%cl_options%" CXXFLAGS="%cl_options%" LDFLAGS="-LTCG" cmake -G "Visual Studio 17 2022" -A Win32 -DCMAKE_SYSTEM_VERSION=%CMAKE_SYSTEM_VERSION% -DCMAKE_EXE_LINKER_FLAGS_INIT=/LTCG -DCMAKE_SHARED_LINKER_FLAGS_INIT=/LTCG -DCMAKE_STATIC_LINKER_FLAGS_INIT=/LTCG -DCMAKE_MODULE_LINKER_FLAGS_INIT=/LTCG -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true -DCOMPILE_D3D12_HOOK=true -DENABLE_SCRIPTING=false -DBUILD_BROWSER=OFF -DBUILD_VST=OFF ..
# build 32bit game capture plugin
- call msbuild /m /p:Configuration=%build_config% C:\projects\obs-studio\build32\plugins/win-capture/get-graphics-offsets/get-graphics-offsets.vcxproj /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- call msbuild /m /p:Configuration=%build_config% C:\projects\obs-studio\build32\plugins/win-capture/graphics-hook/graphics-hook.vcxproj /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- call msbuild /m /p:Configuration=%build_config% C:\projects\obs-studio\build32\plugins/win-capture/inject-helper/inject-helper.vcxproj /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
# package Artifact
# back to project root
- cd ..
- C:\projects\obs-studio\CI\before-deploy-win.cmd
- ps: Push-AppveyorArtifact "build.7z" -FileName "OBS-git-craftwar-${env:favor_arch}-${env:vc_inc_arch}.7z"
- ps: Push-AppveyorArtifact "build64\plugins\obs-text\Release\obs-text.dll" -FileName "obs-text-${env:favor_arch}-${env:vc_inc_arch}.dll"
- ps: Push-AppveyorArtifact "version.txt" -FileName "${env:favor_arch}-${env:vc_inc_arch}.txt"
- '"%APPVEYOR_BUILD_FOLDER%\CI\craftwar\download game capture.cmd"'
- ps: if (${env:favor_arch} -eq "AMD64" -And ${env:vc_inc_arch} -eq "SSE2") { Push-AppveyorArtifact gc.7z }
- set release=%APPVEYOR_REPO_COMMIT:~0,7%
- if "%vc_inc_arch%"=="AVX2" C:\projects\obs-studio\CI\craftwar\obs-text-blend.cmd
deploy:
- provider: Environment
name: github git
tag: git
release: $(release)
force_update: true
on:
branch: master
test: off
cache:
- C:\tools\vcpkg\installed\ -> appveyor.yml
- dependencies2019.zip
- '%VCdeps_file%'
# for SSE2
- vlc.zip
- 'cef_binary_%WINDOWS_CEF_BUILD_VERSION%_windows_x64.zip'
- Jim_OBS
#notifications:
# - provider: Webhook
# url:
# secure: k1kpaz4CB5Rg5a3MTb4XKnd76fJ+9ozz5RACVnNjdgmAjA1OSssZ6LZ3g0NGfzc/
# headers:
# Authorization:
# secure: A0PBwpHtsYzBOuye1EeS0fl562T0NZEInwZp0ZVER1wLQSeE6gzWGrRo2a0E7hii