-
Notifications
You must be signed in to change notification settings - Fork 371
213 lines (191 loc) · 7.02 KB
/
build-multiconfig-msvc.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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
# This workflow validates the build on Windows using MSVC and Clang compilers.
# It is triggered on pushes to the master branch.
# The workflow includes steps to install dependencies, configure, build, and clean up the project for different configurations.
name: MSVC build validation
on:
push:
branches:
- 'master'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
main_job:
name: Windows MSVC/Clang validation
runs-on: windows-2022
strategy:
matrix:
config:
- {
name: "MSVC",
cc: "cl",
cxx: "cl",
generator: "Visual Studio 17 2022",
toolset: "host=x64",
c_flags: "/W4 /WX",
cxx_flags: "/W4 /WX"
}
- {
name: "Clang",
cc: "clang",
cxx: "clang++",
generator: "Ninja",
toolset: "",
c_flags: "-Werror -Wall -Wextra -Wno-unknown-warning-option",
cxx_flags: "-Werror -Wall -Wextra -Wno-unknown-warning-option"
}
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Set up MSVC
uses: ilammy/[email protected]
with:
arch: x64
- name: Download and extract 3rdparty dependencies
run: |
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
Remove-Item 3rdparty-vc14-64.zip
shell: pwsh
- name: Download and extract Mesa3D
run: |
curl -L -o mesa3d.7z https://github.com/pal1000/mesa-dist-win/releases/download/24.3.2/mesa3d-24.3.2-release-mingw.7z
7z x mesa3d.7z -omesa3d
- name: Run system-wide deployment
run: |
cd mesa3d
.\systemwidedeploy.cmd 1
.\systemwidedeploy.cmd 5
shell: cmd
- name: Configure basic
run: |
mkdir build
cd build
cmake -G "${{ matrix.config.generator }}" ${{ matrix.config.toolset }} `
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} `
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} `
-D 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 `
-D CMAKE_CXX_FLAGS="${{ matrix.config.cxx_flags }}" `
-D CMAKE_C_FLAGS="${{ matrix.config.c_flags }}" ..
shell: pwsh
- name: Build basic
run: |
cd build
cmake --build . --config Release
shell: pwsh
- name: Clear up after build
run: |
Remove-Item -Recurse -Force build
shell: pwsh
- name: Configure full shared
run: |
mkdir build
cd build
cmake -G "${{ matrix.config.generator }}" ${{ matrix.config.toolset }} `
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} `
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} `
-D BUILD_USE_PCH=OFF `
-D BUILD_INCLUDE_SYMLINK=ON `
-D BUILD_OPT_PROFILE=Production `
-D BUILD_LIBRARY_TYPE=Shared `
-D CMAKE_BUILD_TYPE=Debug `
-D INSTALL_DIR=${{ github.workspace }}/install `
-D 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 `
-D USE_MMGR_TYPE=JEMALLOC `
-D USE_FREETYPE=ON `
-D USE_DRACO=ON `
-D USE_FFMPEG=ON `
-D USE_FREEIMAGE=ON `
-D USE_GLES2=ON `
-D USE_OPENVR=ON `
-D USE_VTK=${{ matrix.config.name == 'MSVC' && 'ON' || 'OFF' }} `
-D USE_TBB=ON `
-D USE_RAPIDJSON=ON `
-D USE_OPENGL=ON `
-D CMAKE_CXX_FLAGS="${{ matrix.config.cxx_flags }}" `
-D CMAKE_C_FLAGS="${{ matrix.config.c_flags }}" ..
shell: pwsh
- name: Build full shared
run: |
cd build
cmake --build . --target install --config Debug
shell: pwsh
- name: Clear up after build
run: |
Remove-Item -Recurse -Force build
Remove-Item -Recurse -Force ${{ github.workspace }}/install
shell: pwsh
- name: Configure full static
run: |
mkdir build
cd build
cmake -G "${{ matrix.config.generator }}" ${{ matrix.config.toolset }} `
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} `
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} `
-D BUILD_USE_PCH=OFF `
-D BUILD_INCLUDE_SYMLINK=ON `
-D BUILD_OPT_PROFILE=Production `
-D BUILD_LIBRARY_TYPE=Static `
-D CMAKE_BUILD_TYPE=Debug `
-D INSTALL_DIR=${{ github.workspace }}/install `
-D 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 `
-D USE_MMGR_TYPE=JEMALLOC `
-D USE_FREETYPE=ON `
-D USE_DRACO=ON `
-D USE_FFMPEG=ON `
-D USE_FREEIMAGE=ON `
-D USE_GLES2=ON `
-D USE_OPENVR=ON `
-D USE_VTK=OFF `
-D USE_TBB=ON `
-D USE_RAPIDJSON=ON `
-D USE_OPENGL=ON `
-D CMAKE_CXX_FLAGS="${{ matrix.config.cxx_flags }}" `
-D CMAKE_C_FLAGS="${{ matrix.config.c_flags }}" ..
shell: pwsh
- name: Build full static
run: |
cd build
cmake --build . --target install --config Debug
shell: pwsh
- name: Clear up after build
run: |
Remove-Item -Recurse -Force build
Remove-Item -Recurse -Force ${{ github.workspace }}/install
shell: pwsh
- name: Configure full with DEBUG define
run: |
mkdir build
cd build
cmake -G "${{ matrix.config.generator }}" ${{ matrix.config.toolset }} `
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} `
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} `
-D BUILD_WITH_DEBUG=ON `
-D BUILD_USE_PCH=OFF `
-D BUILD_INCLUDE_SYMLINK=ON `
-D BUILD_OPT_PROFILE=Production `
-D BUILD_LIBRARY_TYPE=Shared `
-D CMAKE_BUILD_TYPE=Debug `
-D INSTALL_DIR=${{ github.workspace }}/install `
-D 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 `
-D USE_FREETYPE=ON `
-D USE_DRACO=ON `
-D USE_FFMPEG=ON `
-D USE_FREEIMAGE=ON `
-D USE_GLES2=ON `
-D USE_OPENVR=ON `
-D USE_VTK=${{ matrix.config.name == 'MSVC' && 'ON' || 'OFF' }} `
-D USE_TBB=ON `
-D USE_RAPIDJSON=ON `
-D USE_OPENGL=ON ` ..
shell: pwsh
- name: Build full with DEBUG define
run: |
cd build
cmake --build . --target install --config Debug
shell: pwsh
- name: Clear up after build
run: |
Remove-Item -Recurse -Force build
Remove-Item -Recurse -Force ${{ github.workspace }}/install
shell: pwsh