aboutsummaryrefslogtreecommitdiffhomepage
path: root/gyp/shaderc.gyp
blob: 0eb608194c2e2286bdb8dd7ad10fe28c2e7f34ce (plain)
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
# Copyright 2016 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# Builds shaderc for the Vulkan backend
{
  'targets': [
    {
      'target_name': 'shaderc_combined',
      'type': 'static_library',
      'dependencies': [
        'libshaderc',
        'libshaderc_util',
        'liboglcompiler',
        'libspirv',
        'libglslangosdependent',
        'libglslang',
      ],
      'all_dependent_settings': {
        'include_dirs': [
          '../third_party/externals/shaderc2/libshaderc/include',
        ],
      },
    },
    {
      'target_name': 'libshaderc',
      'type': 'static_library',
      'cflags': [
        '-w',
      ],
      'xcode_settings': {
        'WARNING_CFLAGS': [
          '-w'
        ],
      },
      'include_dirs': [
        '../third_party/externals/shaderc2/libshaderc/include',
        '../third_party/externals/shaderc2/libshaderc_util/include',
        '../third_party/externals/shaderc2/third_party/glslang',
      ],
      'sources': [
        '../third_party/externals/shaderc2/libshaderc/include/shaderc/shaderc.hpp',
        '../third_party/externals/shaderc2/libshaderc/src/shaderc.cc',
      ],
    },
    {
      'target_name': 'libshaderc_util',
      'type': 'static_library',
      'dependencies': [
        'libspirvtools'
      ],
      'cflags': [
        '-w',
      ],
      'xcode_settings': {
        'WARNING_CFLAGS': [
          '-w'
        ],
      },
      'include_dirs': [
        '../third_party/externals/shaderc2/libshaderc_util/include',
        '../third_party/externals/shaderc2/third_party/glslang',
        '../third_party/externals/shaderc2/third_party/spirv-tools/include',
      ],
      'sources': [
        '../third_party/externals/shaderc2/libshaderc_util/src/compiler.cc',
        '../third_party/externals/shaderc2/libshaderc_util/src/file_finder.cc',
        '../third_party/externals/shaderc2/libshaderc_util/src/io.cc',
        '../third_party/externals/shaderc2/libshaderc_util/src/message.cc',
        '../third_party/externals/shaderc2/libshaderc_util/src/resources.cc',
        '../third_party/externals/shaderc2/libshaderc_util/src/shader_stage.cc',
        '../third_party/externals/shaderc2/libshaderc_util/src/version_profile.cc',
      ],
    },
    {
      'target_name': 'libspirv',
      'type': 'static_library',
      'cflags': [
        '-w',
      ],
      'xcode_settings': {
        'WARNING_CFLAGS': [
          '-w'
        ],
      },
      'include_dirs': [
        '../third_party/externals/shaderc2/third_party/glslang',
      ],
      'sources': [
        '../third_party/externals/shaderc2/third_party/glslang/SPIRV/GlslangToSpv.cpp',
        '../third_party/externals/shaderc2/third_party/glslang/SPIRV/InReadableOrder.cpp',
        '../third_party/externals/shaderc2/third_party/glslang/SPIRV/SpvBuilder.cpp',
        '../third_party/externals/shaderc2/third_party/glslang/SPIRV/SPVRemapper.cpp',
        '../third_party/externals/shaderc2/third_party/glslang/SPIRV/doc.cpp',
        '../third_party/externals/shaderc2/third_party/glslang/SPIRV/disassemble.cpp',
      ],
    },
    {
      'target_name': 'liboglcompiler',
      'type': 'static_library',
      'cflags': [
        '-w',
      ],
      'xcode_settings': {
        'WARNING_CFLAGS': [
          '-w'
        ],
      },
      'include_dirs': [
        '../third_party/externals/shaderc2/third_party/glslang/OGLCompilersDLL',
      ],
      'sources': [
        '../third_party/externals/shaderc2/third_party/glslang/OGLCompilersDLL/InitializeDll.cpp',
      ],
    },
    {
      'target_name': 'libglslangosdependent',
      'type': 'static_library',
      'cflags': [
        '-w',
      ],
      'xcode_settings': {
        'WARNING_CFLAGS': [
          '-w'
        ],
      },
      'conditions': [
        ['skia_os == "win"', {
          'include_dirs': [
            '../third_party/externals/shaderc2/third_party/glslang/glslang/OSDependent/Windows',
          ],
          'sources': [
            '../third_party/externals/shaderc2/third_party/glslang/glslang/OSDependent/Windows/ossource.cpp',
          ],
        }, {
          'include_dirs': [
            '../third_party/externals/shaderc2/third_party/glslang/glslang/OSDependent/Unix',
          ],
          'sources': [
            '../third_party/externals/shaderc2/third_party/glslang/glslang/OSDependent/Unix/ossource.cpp',
          ],
        }],
      ],
    },
    {
      'target_name': 'libglslang',
      'type': 'static_library',
      'cflags': [
        '-w',
      ],
      'xcode_settings': {
        'WARNING_CFLAGS': [
          '-w'
        ],
      },
      'msvs_settings': {
        'VCCLCompilerTool': {
          'AdditionalOptions': [
            '/wd4800',
            '/wd4005',
            '/wd4189',
          ],
        },
      },
      'include_dirs': [
        '../third_party/externals/shaderc2/third_party/glslang/glslang/Include',
      ],
      'sources': [
            '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/glslang.y',
            '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/glslang_tab.cpp',
            '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/Constant.cpp',
            '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/InfoSink.cpp',
            '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/Initialize.cpp',
            '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/IntermTraverse.cpp',
            '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/Intermediate.cpp',
            '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/ParseHelper.cpp',
            '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/PoolAlloc.cpp',
            '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/RemoveTree.cpp',
            '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/Scan.cpp',
            '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/ShaderLang.cpp',
            '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/SymbolTable.cpp',
            '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/Versions.cpp',
            '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/intermOut.cpp',
            '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/limits.cpp',
            '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/linkValidate.cpp',
            '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/parseConst.cpp',
            '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/reflection.cpp',
            '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp',
            '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/preprocessor/PpAtom.cpp',
            '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp',
            '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/preprocessor/PpMemory.cpp',
            '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp',
            '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/preprocessor/PpSymbols.cpp',
            '../third_party/externals/shaderc2/third_party/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp',
            '../third_party/externals/shaderc2/third_party/glslang/glslang/GenericCodeGen/CodeGen.cpp',
            '../third_party/externals/shaderc2/third_party/glslang/glslang/GenericCodeGen/Link.cpp',
            '../third_party/externals/shaderc2/third_party/glslang/hlsl/hlslParseHelper.cpp',
            '../third_party/externals/shaderc2/third_party/glslang/hlsl/hlslScanContext.cpp',
            '../third_party/externals/shaderc2/third_party/glslang/hlsl/hlslGrammar.cpp',
      ],
    },
    {
      'target_name': 'libspirvtools',
      'type': 'static_library',
      'dependencies': [
        'genspirvtools',
      ],
      'cflags': [
        '-w',
      ],
      'xcode_settings': {
        'WARNING_CFLAGS': [
          '-w'
        ],
      },
      'msvs_settings': {
        'VCCLCompilerTool': {
          'AdditionalOptions': [
            '/wd4800',
          ],
        },
      },
      'include_dirs': [
        '../third_party/externals/shaderc2/third_party/spirv-tools/include',
        '../third_party/externals/shaderc2/third_party/spirv-tools/source',
      ],
      'sources': [
        '../third_party/externals/shaderc2/third_party/spirv-tools/source/assembly_grammar.cpp',
        '../third_party/externals/shaderc2/third_party/spirv-tools/source/binary.cpp',
        '../third_party/externals/shaderc2/third_party/spirv-tools/source/diagnostic.cpp',
        '../third_party/externals/shaderc2/third_party/spirv-tools/source/disassemble.cpp',
        '../third_party/externals/shaderc2/third_party/spirv-tools/source/ext_inst.cpp',
        '../third_party/externals/shaderc2/third_party/spirv-tools/source/instruction.cpp',
        '../third_party/externals/shaderc2/third_party/spirv-tools/source/opcode.cpp',
        '../third_party/externals/shaderc2/third_party/spirv-tools/source/operand.cpp',
        '../third_party/externals/shaderc2/third_party/spirv-tools/source/print.cpp',
        '../third_party/externals/shaderc2/third_party/spirv-tools/source/spirv_endian.cpp',
        '../third_party/externals/shaderc2/third_party/spirv-tools/source/spirv_target_env.cpp',
        '../third_party/externals/shaderc2/third_party/spirv-tools/source/table.cpp',
        '../third_party/externals/shaderc2/third_party/spirv-tools/source/text.cpp',
        '../third_party/externals/shaderc2/third_party/spirv-tools/source/text_handler.cpp',
        '../third_party/externals/shaderc2/third_party/spirv-tools/source/validate.cpp',
        '../third_party/externals/shaderc2/third_party/spirv-tools/source/validate_cfg.cpp',
        '../third_party/externals/shaderc2/third_party/spirv-tools/source/validate_id.cpp',
        '../third_party/externals/shaderc2/third_party/spirv-tools/source/validate_instruction.cpp',
        '../third_party/externals/shaderc2/third_party/spirv-tools/source/validate_layout.cpp',
        '../third_party/externals/shaderc2/third_party/spirv-tools/source/validate_ssa.cpp',
        '../third_party/externals/shaderc2/third_party/spirv-tools/source/validate_types.cpp',
      ],
    },
    {
      'target_name': 'genspirvtools',
      'type': 'none',
      'actions': [
        {
          'action_name': 'produce_glsl-1-0',
          'inputs': [
            '../third_party/externals/shaderc2/third_party/spirv-tools/utils/generate_grammar_tables.py',
            '../third_party/externals/shaderc2/third_party/spirv-tools/source/spirv-1-0.core.grammar.json',
            '../third_party/externals/shaderc2/third_party/spirv-tools/source/extinst-1-0.glsl.std.450.grammar.json',
          ],
          'outputs': [
             '../third_party/externals/shaderc2/third_party/spirv-tools/source/glsl.std.450.insts-1-0.inc',
          ],
          'action': [
            'python',
            '../third_party/externals/shaderc2/third_party/spirv-tools/utils/generate_grammar_tables.py',
            '--spirv-core-grammar',
            '../third_party/externals/shaderc2/third_party/spirv-tools/source/spirv-1-0.core.grammar.json',
            '--extinst-glsl-grammar',
            '../third_party/externals/shaderc2/third_party/spirv-tools/source/extinst-1-0.glsl.std.450.grammar.json',
            '--glsl-insts-output',
            '../third_party/externals/shaderc2/third_party/spirv-tools/source/glsl.std.450.insts-1-0.inc',
          ],
        },
        {
          'action_name': 'produce_core_operand-1-0',
          'inputs': [
            '../third_party/externals/shaderc2/third_party/spirv-tools/utils/generate_grammar_tables.py',
            '../third_party/externals/shaderc2/third_party/spirv-tools/source/spirv-1-0.core.grammar.json',
          ],
          'outputs': [
             '../third_party/externals/shaderc2/third_party/spirv-tools/source/core.insts-1-0.inc',
             '../third_party/externals/shaderc2/third_party/spirv-tools/source/operand.kinds-1-0.inc',
          ],
          'action': [
            'python',
            '../third_party/externals/shaderc2/third_party/spirv-tools/utils/generate_grammar_tables.py',
            '--spirv-core-grammar',
            '../third_party/externals/shaderc2/third_party/spirv-tools/source/spirv-1-0.core.grammar.json',
            '--core-insts-output',
            '../third_party/externals/shaderc2/third_party/spirv-tools/source/core.insts-1-0.inc',
            '--operand-kinds-output',
            '../third_party/externals/shaderc2/third_party/spirv-tools/source/operand.kinds-1-0.inc'
          ],
        },
        {
          'action_name': 'produce_core_operand-1-1',
          'inputs': [
            '../third_party/externals/shaderc2/third_party/spirv-tools/utils/generate_grammar_tables.py',
            '../third_party/externals/shaderc2/third_party/spirv-tools/source/spirv-1-1.core.grammar.json',
          ],
          'outputs': [
             '../third_party/externals/shaderc2/third_party/spirv-tools/source/core.insts-1-1.inc',
             '../third_party/externals/shaderc2/third_party/spirv-tools/source/operand.kinds-1-1.inc',
          ],
          'action': [
            'python',
            '../third_party/externals/shaderc2/third_party/spirv-tools/utils/generate_grammar_tables.py',
            '--spirv-core-grammar',
            '../third_party/externals/shaderc2/third_party/spirv-tools/source/spirv-1-1.core.grammar.json',
            '--core-insts-output',
            '../third_party/externals/shaderc2/third_party/spirv-tools/source/core.insts-1-1.inc',
            '--operand-kinds-output',
            '../third_party/externals/shaderc2/third_party/spirv-tools/source/operand.kinds-1-1.inc'
          ],
        },
        {
          'action_name': 'produce_opencl-1-0',
          'inputs': [
            '../third_party/externals/shaderc2/third_party/spirv-tools/utils/generate_grammar_tables.py',
            '../third_party/externals/shaderc2/third_party/spirv-tools/source/spirv-1-0.core.grammar.json',
            '../third_party/externals/shaderc2/third_party/spirv-tools/source/extinst-1-0.opencl.std.grammar.json',
          ],
          'outputs': [
             '../third_party/externals/shaderc2/third_party/spirv-tools/source/opencl.std.insts-1-0.inc',
          ],
          'action': [
            'python',
            '../third_party/externals/shaderc2/third_party/spirv-tools/utils/generate_grammar_tables.py',
            '--spirv-core-grammar',
            '../third_party/externals/shaderc2/third_party/spirv-tools/source/spirv-1-1.core.grammar.json',
            '--extinst-opencl-grammar',
            '../third_party/externals/shaderc2/third_party/spirv-tools/source/extinst-1-0.opencl.std.grammar.json',
            '--opencl-insts-output',
            '../third_party/externals/shaderc2/third_party/spirv-tools/source/opencl.std.insts-1-0.inc'
          ],
        },
      ],
    },
  ],
}