blob: 0eb608194c2e2286bdb8dd7ad10fe28c2e7f34ce [file] [log] [blame]
bsalomonde7bbab2016-03-03 15:43:03 -08001# Copyright 2016 Google Inc.
2#
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6# Builds shaderc for the Vulkan backend
7{
kjlubickb7b42932016-06-10 12:07:50 -07008 'targets': [
bsalomonde7bbab2016-03-03 15:43:03 -08009 {
bsalomonde7bbab2016-03-03 15:43:03 -080010 'target_name': 'shaderc_combined',
kjlubickb7b42932016-06-10 12:07:50 -070011 'type': 'static_library',
12 'dependencies': [
13 'libshaderc',
14 'libshaderc_util',
15 'liboglcompiler',
16 'libspirv',
17 'libglslangosdependent',
18 'libglslang',
bsalomonde7bbab2016-03-03 15:43:03 -080019 ],
egdaniel75d2bfc2016-07-07 08:04:08 -070020 'all_dependent_settings': {
djsollend5fd2ff2016-07-06 09:17:35 -070021 'include_dirs': [
22 '../third_party/externals/shaderc2/libshaderc/include',
23 ],
24 },
kjlubickb7b42932016-06-10 12:07:50 -070025 },
26 {
27 'target_name': 'libshaderc',
28 'type': 'static_library',
29 'cflags': [
30 '-w',
31 ],
32 'xcode_settings': {
33 'WARNING_CFLAGS': [
34 '-w'
35 ],
36 },
37 'include_dirs': [
38 '../third_party/externals/shaderc2/libshaderc/include',
39 '../third_party/externals/shaderc2/libshaderc_util/include',
40 '../third_party/externals/shaderc2/third_party/glslang',
41 ],
42 'sources': [
43 '../third_party/externals/shaderc2/libshaderc/include/shaderc/shaderc.hpp',
44 '../third_party/externals/shaderc2/libshaderc/src/shaderc.cc',
45 ],
46 },
47 {
48 'target_name': 'libshaderc_util',
49 'type': 'static_library',
50 'dependencies': [
51 'libspirvtools'
52 ],
53 'cflags': [
54 '-w',
55 ],
56 'xcode_settings': {
57 'WARNING_CFLAGS': [
58 '-w'
59 ],
60 },
61 'include_dirs': [
62 '../third_party/externals/shaderc2/libshaderc_util/include',
63 '../third_party/externals/shaderc2/third_party/glslang',
64 '../third_party/externals/shaderc2/third_party/spirv-tools/include',
65 ],
66 'sources': [
67 '../third_party/externals/shaderc2/libshaderc_util/src/compiler.cc',
68 '../third_party/externals/shaderc2/libshaderc_util/src/file_finder.cc',
69 '../third_party/externals/shaderc2/libshaderc_util/src/io.cc',
70 '../third_party/externals/shaderc2/libshaderc_util/src/message.cc',
71 '../third_party/externals/shaderc2/libshaderc_util/src/resources.cc',
72 '../third_party/externals/shaderc2/libshaderc_util/src/shader_stage.cc',
73 '../third_party/externals/shaderc2/libshaderc_util/src/version_profile.cc',
74 ],
75 },
76 {
77 'target_name': 'libspirv',
78 'type': 'static_library',
79 'cflags': [
80 '-w',
81 ],
82 'xcode_settings': {
83 'WARNING_CFLAGS': [
84 '-w'
85 ],
86 },
87 'include_dirs': [
88 '../third_party/externals/shaderc2/third_party/glslang',
89 ],
90 'sources': [
91 '../third_party/externals/shaderc2/third_party/glslang/SPIRV/GlslangToSpv.cpp',
92 '../third_party/externals/shaderc2/third_party/glslang/SPIRV/InReadableOrder.cpp',
93 '../third_party/externals/shaderc2/third_party/glslang/SPIRV/SpvBuilder.cpp',
94 '../third_party/externals/shaderc2/third_party/glslang/SPIRV/SPVRemapper.cpp',
95 '../third_party/externals/shaderc2/third_party/glslang/SPIRV/doc.cpp',
96 '../third_party/externals/shaderc2/third_party/glslang/SPIRV/disassemble.cpp',
97 ],
98 },
99 {
100 'target_name': 'liboglcompiler',
101 'type': 'static_library',
102 'cflags': [
103 '-w',
104 ],
105 'xcode_settings': {
106 'WARNING_CFLAGS': [
107 '-w'
108 ],
109 },
110 'include_dirs': [
111 '../third_party/externals/shaderc2/third_party/glslang/OGLCompilersDLL',
112 ],
113 'sources': [
114 '../third_party/externals/shaderc2/third_party/glslang/OGLCompilersDLL/InitializeDll.cpp',
115 ],
116 },
117 {
118 'target_name': 'libglslangosdependent',
119 'type': 'static_library',
120 'cflags': [
121 '-w',
122 ],
123 'xcode_settings': {
124 'WARNING_CFLAGS': [
125 '-w'
126 ],
127 },
128 'conditions': [
129 ['skia_os == "win"', {
130 'include_dirs': [
131 '../third_party/externals/shaderc2/third_party/glslang/glslang/OSDependent/Windows',
132 ],
133 'sources': [
134 '../third_party/externals/shaderc2/third_party/glslang/glslang/OSDependent/Windows/ossource.cpp',
135 ],
136 }, {
137 'include_dirs': [
138 '../third_party/externals/shaderc2/third_party/glslang/glslang/OSDependent/Unix',
139 ],
140 'sources': [
141 '../third_party/externals/shaderc2/third_party/glslang/glslang/OSDependent/Unix/ossource.cpp',
142 ],
143 }],
144 ],
145 },
146 {
147 'target_name': 'libglslang',
148 'type': 'static_library',
149 'cflags': [
150 '-w',
151 ],
152 'xcode_settings': {
153 'WARNING_CFLAGS': [
154 '-w'
155 ],
156 },
157 'msvs_settings': {
158 'VCCLCompilerTool': {
159 'AdditionalOptions': [
160 '/wd4800',
161 '/wd4005',
162 '/wd4189',
bsalomonde7bbab2016-03-03 15:43:03 -0800163 ],
164 },
165 },
kjlubickb7b42932016-06-10 12:07:50 -0700166 'include_dirs': [
167 '../third_party/externals/shaderc2/third_party/glslang/glslang/Include',
168 ],
169 'sources': [
170 '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/glslang.y',
171 '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/glslang_tab.cpp',
172 '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/Constant.cpp',
173 '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/InfoSink.cpp',
174 '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/Initialize.cpp',
175 '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/IntermTraverse.cpp',
176 '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/Intermediate.cpp',
177 '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/ParseHelper.cpp',
178 '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/PoolAlloc.cpp',
179 '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/RemoveTree.cpp',
180 '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/Scan.cpp',
181 '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/ShaderLang.cpp',
182 '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/SymbolTable.cpp',
183 '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/Versions.cpp',
184 '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/intermOut.cpp',
185 '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/limits.cpp',
186 '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/linkValidate.cpp',
187 '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/parseConst.cpp',
188 '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/reflection.cpp',
189 '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp',
190 '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/preprocessor/PpAtom.cpp',
191 '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp',
192 '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/preprocessor/PpMemory.cpp',
193 '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp',
194 '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/preprocessor/PpSymbols.cpp',
195 '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp',
196 '../third_party/externals/shaderc2/third_party/glslang/glslang/GenericCodeGen/CodeGen.cpp',
197 '../third_party/externals/shaderc2/third_party/glslang/glslang/GenericCodeGen/Link.cpp',
198 '../third_party/externals/shaderc2/third_party/glslang/hlsl/hlslParseHelper.cpp',
199 '../third_party/externals/shaderc2/third_party/glslang/hlsl/hlslScanContext.cpp',
200 '../third_party/externals/shaderc2/third_party/glslang/hlsl/hlslGrammar.cpp',
201 ],
202 },
203 {
204 'target_name': 'libspirvtools',
205 'type': 'static_library',
206 'dependencies': [
207 'genspirvtools',
208 ],
209 'cflags': [
210 '-w',
211 ],
212 'xcode_settings': {
213 'WARNING_CFLAGS': [
214 '-w'
215 ],
216 },
217 'msvs_settings': {
218 'VCCLCompilerTool': {
219 'AdditionalOptions': [
220 '/wd4800',
221 ],
222 },
223 },
224 'include_dirs': [
225 '../third_party/externals/shaderc2/third_party/spirv-tools/include',
226 '../third_party/externals/shaderc2/third_party/spirv-tools/source',
227 ],
228 'sources': [
229 '../third_party/externals/shaderc2/third_party/spirv-tools/source/assembly_grammar.cpp',
230 '../third_party/externals/shaderc2/third_party/spirv-tools/source/binary.cpp',
231 '../third_party/externals/shaderc2/third_party/spirv-tools/source/diagnostic.cpp',
232 '../third_party/externals/shaderc2/third_party/spirv-tools/source/disassemble.cpp',
233 '../third_party/externals/shaderc2/third_party/spirv-tools/source/ext_inst.cpp',
234 '../third_party/externals/shaderc2/third_party/spirv-tools/source/instruction.cpp',
235 '../third_party/externals/shaderc2/third_party/spirv-tools/source/opcode.cpp',
236 '../third_party/externals/shaderc2/third_party/spirv-tools/source/operand.cpp',
237 '../third_party/externals/shaderc2/third_party/spirv-tools/source/print.cpp',
238 '../third_party/externals/shaderc2/third_party/spirv-tools/source/spirv_endian.cpp',
239 '../third_party/externals/shaderc2/third_party/spirv-tools/source/spirv_target_env.cpp',
240 '../third_party/externals/shaderc2/third_party/spirv-tools/source/table.cpp',
241 '../third_party/externals/shaderc2/third_party/spirv-tools/source/text.cpp',
242 '../third_party/externals/shaderc2/third_party/spirv-tools/source/text_handler.cpp',
243 '../third_party/externals/shaderc2/third_party/spirv-tools/source/validate.cpp',
244 '../third_party/externals/shaderc2/third_party/spirv-tools/source/validate_cfg.cpp',
245 '../third_party/externals/shaderc2/third_party/spirv-tools/source/validate_id.cpp',
246 '../third_party/externals/shaderc2/third_party/spirv-tools/source/validate_instruction.cpp',
247 '../third_party/externals/shaderc2/third_party/spirv-tools/source/validate_layout.cpp',
248 '../third_party/externals/shaderc2/third_party/spirv-tools/source/validate_ssa.cpp',
249 '../third_party/externals/shaderc2/third_party/spirv-tools/source/validate_types.cpp',
250 ],
251 },
252 {
253 'target_name': 'genspirvtools',
254 'type': 'none',
255 'actions': [
256 {
257 'action_name': 'produce_glsl-1-0',
258 'inputs': [
259 '../third_party/externals/shaderc2/third_party/spirv-tools/utils/generate_grammar_tables.py',
260 '../third_party/externals/shaderc2/third_party/spirv-tools/source/spirv-1-0.core.grammar.json',
261 '../third_party/externals/shaderc2/third_party/spirv-tools/source/extinst-1-0.glsl.std.450.grammar.json',
262 ],
263 'outputs': [
264 '../third_party/externals/shaderc2/third_party/spirv-tools/source/glsl.std.450.insts-1-0.inc',
265 ],
266 'action': [
267 'python',
268 '../third_party/externals/shaderc2/third_party/spirv-tools/utils/generate_grammar_tables.py',
269 '--spirv-core-grammar',
270 '../third_party/externals/shaderc2/third_party/spirv-tools/source/spirv-1-0.core.grammar.json',
271 '--extinst-glsl-grammar',
272 '../third_party/externals/shaderc2/third_party/spirv-tools/source/extinst-1-0.glsl.std.450.grammar.json',
273 '--glsl-insts-output',
274 '../third_party/externals/shaderc2/third_party/spirv-tools/source/glsl.std.450.insts-1-0.inc',
275 ],
276 },
277 {
278 'action_name': 'produce_core_operand-1-0',
279 'inputs': [
280 '../third_party/externals/shaderc2/third_party/spirv-tools/utils/generate_grammar_tables.py',
281 '../third_party/externals/shaderc2/third_party/spirv-tools/source/spirv-1-0.core.grammar.json',
282 ],
283 'outputs': [
284 '../third_party/externals/shaderc2/third_party/spirv-tools/source/core.insts-1-0.inc',
285 '../third_party/externals/shaderc2/third_party/spirv-tools/source/operand.kinds-1-0.inc',
286 ],
287 'action': [
288 'python',
289 '../third_party/externals/shaderc2/third_party/spirv-tools/utils/generate_grammar_tables.py',
290 '--spirv-core-grammar',
291 '../third_party/externals/shaderc2/third_party/spirv-tools/source/spirv-1-0.core.grammar.json',
292 '--core-insts-output',
293 '../third_party/externals/shaderc2/third_party/spirv-tools/source/core.insts-1-0.inc',
294 '--operand-kinds-output',
295 '../third_party/externals/shaderc2/third_party/spirv-tools/source/operand.kinds-1-0.inc'
296 ],
297 },
298 {
299 'action_name': 'produce_core_operand-1-1',
300 'inputs': [
301 '../third_party/externals/shaderc2/third_party/spirv-tools/utils/generate_grammar_tables.py',
302 '../third_party/externals/shaderc2/third_party/spirv-tools/source/spirv-1-1.core.grammar.json',
303 ],
304 'outputs': [
305 '../third_party/externals/shaderc2/third_party/spirv-tools/source/core.insts-1-1.inc',
306 '../third_party/externals/shaderc2/third_party/spirv-tools/source/operand.kinds-1-1.inc',
307 ],
308 'action': [
309 'python',
310 '../third_party/externals/shaderc2/third_party/spirv-tools/utils/generate_grammar_tables.py',
311 '--spirv-core-grammar',
312 '../third_party/externals/shaderc2/third_party/spirv-tools/source/spirv-1-1.core.grammar.json',
313 '--core-insts-output',
314 '../third_party/externals/shaderc2/third_party/spirv-tools/source/core.insts-1-1.inc',
315 '--operand-kinds-output',
316 '../third_party/externals/shaderc2/third_party/spirv-tools/source/operand.kinds-1-1.inc'
317 ],
318 },
319 {
320 'action_name': 'produce_opencl-1-0',
321 'inputs': [
322 '../third_party/externals/shaderc2/third_party/spirv-tools/utils/generate_grammar_tables.py',
323 '../third_party/externals/shaderc2/third_party/spirv-tools/source/spirv-1-0.core.grammar.json',
324 '../third_party/externals/shaderc2/third_party/spirv-tools/source/extinst-1-0.opencl.std.grammar.json',
325 ],
326 'outputs': [
327 '../third_party/externals/shaderc2/third_party/spirv-tools/source/opencl.std.insts-1-0.inc',
328 ],
329 'action': [
330 'python',
331 '../third_party/externals/shaderc2/third_party/spirv-tools/utils/generate_grammar_tables.py',
332 '--spirv-core-grammar',
333 '../third_party/externals/shaderc2/third_party/spirv-tools/source/spirv-1-1.core.grammar.json',
334 '--extinst-opencl-grammar',
335 '../third_party/externals/shaderc2/third_party/spirv-tools/source/extinst-1-0.opencl.std.grammar.json',
336 '--opencl-insts-output',
337 '../third_party/externals/shaderc2/third_party/spirv-tools/source/opencl.std.insts-1-0.inc'
338 ],
339 },
340 ],
bsalomonde7bbab2016-03-03 15:43:03 -0800341 },
342 ],
343}