Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Side by Side Diff: gyp/shaderc.gyp

Issue 2047833003: Create .gyp rules for shaderc libraries (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: indents and such Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 Google Inc. 1 # Copyright 2016 Google Inc.
2 # 2 #
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 # Builds shaderc for the Vulkan backend 6 # Builds shaderc for the Vulkan backend
7 { 7 {
8 'variables': { 8 'targets': [
9 'variables': { # This is the dreaded nested variables dict so that we can 9 {
10 # have dependent variables 10 'target_name': 'shaderc_combined',
11 'shaderc_build_configuration': '<(CONFIGURATION_NAME)', 11 'type': 'static_library',
12 'dependencies': [
13 'libshaderc',
14 'libshaderc_util',
15 'liboglcompiler',
16 'libspirv',
17 'libglslangosdependent',
18 'libglslang',
19 ],
20 },
21 {
22 'target_name': 'libshaderc',
23 'type': 'static_library',
24 'cflags': [
25 '-w',
26 ],
27 'xcode_settings': {
28 'WARNING_CFLAGS': [
29 '-w'
30 ],
31 },
32 'include_dirs': [
33 '../third_party/externals/shaderc2/libshaderc/include',
34 '../third_party/externals/shaderc2/libshaderc_util/include',
35 '../third_party/externals/shaderc2/third_party/glslang',
36 ],
37 'sources': [
38 '../third_party/externals/shaderc2/libshaderc/include/shaderc/shaderc.hp p',
39 '../third_party/externals/shaderc2/libshaderc/src/shaderc.cc',
40 ],
41 },
42 {
43 'target_name': 'libshaderc_util',
44 'type': 'static_library',
45 'dependencies': [
46 'libspirvtools'
47 ],
48 'cflags': [
49 '-w',
50 ],
51 'xcode_settings': {
52 'WARNING_CFLAGS': [
53 '-w'
54 ],
55 },
56 'include_dirs': [
57 '../third_party/externals/shaderc2/libshaderc_util/include',
58 '../third_party/externals/shaderc2/third_party/glslang',
59 '../third_party/externals/shaderc2/third_party/spirv-tools/include',
60 ],
61 'sources': [
62 '../third_party/externals/shaderc2/libshaderc_util/src/compiler.cc',
63 '../third_party/externals/shaderc2/libshaderc_util/src/file_finder.cc',
64 '../third_party/externals/shaderc2/libshaderc_util/src/io.cc',
65 '../third_party/externals/shaderc2/libshaderc_util/src/message.cc',
66 '../third_party/externals/shaderc2/libshaderc_util/src/resources.cc',
67 '../third_party/externals/shaderc2/libshaderc_util/src/shader_stage.cc',
68 '../third_party/externals/shaderc2/libshaderc_util/src/version_profile.c c',
69 ],
70 },
71 {
72 'target_name': 'libspirv',
73 'type': 'static_library',
74 'cflags': [
75 '-w',
76 ],
77 'xcode_settings': {
78 'WARNING_CFLAGS': [
79 '-w'
80 ],
81 },
82 'include_dirs': [
83 '../third_party/externals/shaderc2/third_party/glslang',
84 ],
85 'sources': [
86 '../third_party/externals/shaderc2/third_party/glslang/SPIRV/GlslangToSp v.cpp',
87 '../third_party/externals/shaderc2/third_party/glslang/SPIRV/InReadableO rder.cpp',
88 '../third_party/externals/shaderc2/third_party/glslang/SPIRV/SpvBuilder. cpp',
89 '../third_party/externals/shaderc2/third_party/glslang/SPIRV/SPVRemapper .cpp',
90 '../third_party/externals/shaderc2/third_party/glslang/SPIRV/doc.cpp',
91 '../third_party/externals/shaderc2/third_party/glslang/SPIRV/disassemble .cpp',
92 ],
93 },
94 {
95 'target_name': 'liboglcompiler',
96 'type': 'static_library',
97 'cflags': [
98 '-w',
99 ],
100 'xcode_settings': {
101 'WARNING_CFLAGS': [
102 '-w'
103 ],
104 },
105 'include_dirs': [
106 '../third_party/externals/shaderc2/third_party/glslang/OGLCompilersDLL',
107 ],
108 'sources': [
109 '../third_party/externals/shaderc2/third_party/glslang/OGLCompilersDLL/I nitializeDll.cpp',
110 ],
111 },
112 {
113 'target_name': 'libglslangosdependent',
114 'type': 'static_library',
115 'cflags': [
116 '-w',
117 ],
118 'xcode_settings': {
119 'WARNING_CFLAGS': [
120 '-w'
121 ],
122 },
12 'conditions': [ 123 'conditions': [
13 [ 'skia_os == "win"', { 124 ['skia_os == "win"', {
14 'shaderc_lib_name' : 'shaderc_combined.lib', 125 'include_dirs': [
126 '../third_party/externals/shaderc2/third_party/glslang/glslang/OSDep endent/Windows',
127 ],
128 'sources': [
129 '../third_party/externals/shaderc2/third_party/glslang/glslang/OSDep endent/Windows/ossource.cpp',
130 ],
15 }, { 131 }, {
16 'shaderc_lib_name' : 'libshaderc_combined.a', 132 'include_dirs': [
133 '../third_party/externals/shaderc2/third_party/glslang/glslang/OSDep endent/Unix',
134 ],
135 'sources': [
136 '../third_party/externals/shaderc2/third_party/glslang/glslang/OSDep endent/Unix/ossource.cpp',
137 ],
17 }], 138 }],
18 [ 'skia_os == "win"', { 139 ],
19 'conditions': [ 140 },
20 [ 'MSVS_VERSION == "2013"', { 141 {
21 'shaderc_project_type' : 'MSVS2013', 142 'target_name': 'libglslang',
22 }], 143 'type': 'static_library',
23 [ 'MSVS_VERSION == "2015"', { 144 'cflags': [
24 'shaderc_project_type' : 'MSVS2015', 145 '-w',
25 }], 146 ],
26 ], 147 'xcode_settings': {
27 }, { 148 'WARNING_CFLAGS': [
28 'shaderc_project_type' : 'ninja', 149 '-w'
29 }], 150 ],
30 ], 151 },
31 'shaderc_out_path': '<(PRODUCT_DIR)/shaderc_out_<(skia_arch_type)', 152 'msvs_settings': {
32 }, 153 'VCCLCompilerTool': {
33 # Export out of nested variables. 154 'AdditionalOptions': [
34 'shaderc_build_configuration': '<(shaderc_build_configuration)', 155 '/wd4800',
35 'shaderc_project_type': '<(shaderc_project_type)', 156 '/wd4005',
36 'shaderc_out_path': '<(shaderc_out_path)', 157 '/wd4189',
37 'shaderc_lib_name': '<(shaderc_lib_name)', 158 ],
38 'android_toolchain%': '', 159 },
39 160 },
40 # On Windows the library winds up inside a 'Debug' or 'Release' dir, not so 161 'include_dirs': [
41 # with ninja project build. 162 '../third_party/externals/shaderc2/third_party/glslang/glslang/Include',
42 'conditions': [ 163 ],
43 [ 'skia_os == "win"', { 164 'sources': [
44 'shaderc_lib_full_path': '<(shaderc_out_path)/libshaderc/<(shaderc_build _configuration)/<(shaderc_lib_name)', 165 '../third_party/externals/shaderc2/third_party/glslang/glslang/Machi neIndependent/glslang.y',
45 }, { 166 '../third_party/externals/shaderc2/third_party/glslang/glslang/Machi neIndependent/glslang_tab.cpp',
46 'shaderc_lib_full_path': '<(shaderc_out_path)/libshaderc/<(shaderc_lib_n ame)', 167 '../third_party/externals/shaderc2/third_party/glslang/glslang/Machi neIndependent/Constant.cpp',
47 }], 168 '../third_party/externals/shaderc2/third_party/glslang/glslang/Machi neIndependent/InfoSink.cpp',
48 ] 169 '../third_party/externals/shaderc2/third_party/glslang/glslang/Machi neIndependent/Initialize.cpp',
49 }, 170 '../third_party/externals/shaderc2/third_party/glslang/glslang/Machi neIndependent/IntermTraverse.cpp',
50 'targets': [ 171 '../third_party/externals/shaderc2/third_party/glslang/glslang/Machi neIndependent/Intermediate.cpp',
51 { 172 '../third_party/externals/shaderc2/third_party/glslang/glslang/Machi neIndependent/ParseHelper.cpp',
52 # Call out to a python script to build shaderc_combined and then copy it 173 '../third_party/externals/shaderc2/third_party/glslang/glslang/Machi neIndependent/PoolAlloc.cpp',
53 # to out/<Configuration> 174 '../third_party/externals/shaderc2/third_party/glslang/glslang/Machi neIndependent/RemoveTree.cpp',
54 'target_name': 'shaderc_combined', 175 '../third_party/externals/shaderc2/third_party/glslang/glslang/Machi neIndependent/Scan.cpp',
176 '../third_party/externals/shaderc2/third_party/glslang/glslang/Machi neIndependent/ShaderLang.cpp',
177 '../third_party/externals/shaderc2/third_party/glslang/glslang/Machi neIndependent/SymbolTable.cpp',
178 '../third_party/externals/shaderc2/third_party/glslang/glslang/Machi neIndependent/Versions.cpp',
179 '../third_party/externals/shaderc2/third_party/glslang/glslang/Machi neIndependent/intermOut.cpp',
180 '../third_party/externals/shaderc2/third_party/glslang/glslang/Machi neIndependent/limits.cpp',
181 '../third_party/externals/shaderc2/third_party/glslang/glslang/Machi neIndependent/linkValidate.cpp',
182 '../third_party/externals/shaderc2/third_party/glslang/glslang/Machi neIndependent/parseConst.cpp',
183 '../third_party/externals/shaderc2/third_party/glslang/glslang/Machi neIndependent/reflection.cpp',
184 '../third_party/externals/shaderc2/third_party/glslang/glslang/Machi neIndependent/preprocessor/Pp.cpp',
185 '../third_party/externals/shaderc2/third_party/glslang/glslang/Machi neIndependent/preprocessor/PpAtom.cpp',
186 '../third_party/externals/shaderc2/third_party/glslang/glslang/Machi neIndependent/preprocessor/PpContext.cpp',
187 '../third_party/externals/shaderc2/third_party/glslang/glslang/Machi neIndependent/preprocessor/PpMemory.cpp',
188 '../third_party/externals/shaderc2/third_party/glslang/glslang/Machi neIndependent/preprocessor/PpScanner.cpp',
189 '../third_party/externals/shaderc2/third_party/glslang/glslang/Machi neIndependent/preprocessor/PpSymbols.cpp',
190 '../third_party/externals/shaderc2/third_party/glslang/glslang/Machi neIndependent/preprocessor/PpTokens.cpp',
191 '../third_party/externals/shaderc2/third_party/glslang/glslang/Gener icCodeGen/CodeGen.cpp',
192 '../third_party/externals/shaderc2/third_party/glslang/glslang/Gener icCodeGen/Link.cpp',
193 '../third_party/externals/shaderc2/third_party/glslang/hlsl/hlslPars eHelper.cpp',
194 '../third_party/externals/shaderc2/third_party/glslang/hlsl/hlslScan Context.cpp',
195 '../third_party/externals/shaderc2/third_party/glslang/hlsl/hlslGram mar.cpp',
196 ],
197 },
198 {
199 'target_name': 'libspirvtools',
200 'type': 'static_library',
201 'dependencies': [
202 'genspirvtools',
203 ],
204 'cflags': [
205 '-w',
206 ],
207 'xcode_settings': {
208 'WARNING_CFLAGS': [
209 '-w'
210 ],
211 },
212 'msvs_settings': {
213 'VCCLCompilerTool': {
214 'AdditionalOptions': [
215 '/wd4800',
216 ],
217 },
218 },
219 'include_dirs': [
220 '../third_party/externals/shaderc2/third_party/spirv-tools/include',
221 '../third_party/externals/shaderc2/third_party/spirv-tools/source',
222 ],
223 'sources': [
224 '../third_party/externals/shaderc2/third_party/spirv-tools/source/assemb ly_grammar.cpp',
225 '../third_party/externals/shaderc2/third_party/spirv-tools/source/binary .cpp',
226 '../third_party/externals/shaderc2/third_party/spirv-tools/source/diagno stic.cpp',
227 '../third_party/externals/shaderc2/third_party/spirv-tools/source/disass emble.cpp',
228 '../third_party/externals/shaderc2/third_party/spirv-tools/source/ext_in st.cpp',
229 '../third_party/externals/shaderc2/third_party/spirv-tools/source/instru ction.cpp',
230 '../third_party/externals/shaderc2/third_party/spirv-tools/source/opcode .cpp',
231 '../third_party/externals/shaderc2/third_party/spirv-tools/source/operan d.cpp',
232 '../third_party/externals/shaderc2/third_party/spirv-tools/source/print. cpp',
233 '../third_party/externals/shaderc2/third_party/spirv-tools/source/spirv_ endian.cpp',
234 '../third_party/externals/shaderc2/third_party/spirv-tools/source/spirv_ target_env.cpp',
235 '../third_party/externals/shaderc2/third_party/spirv-tools/source/table. cpp',
236 '../third_party/externals/shaderc2/third_party/spirv-tools/source/text.c pp',
237 '../third_party/externals/shaderc2/third_party/spirv-tools/source/text_h andler.cpp',
238 '../third_party/externals/shaderc2/third_party/spirv-tools/source/valida te.cpp',
239 '../third_party/externals/shaderc2/third_party/spirv-tools/source/valida te_cfg.cpp',
240 '../third_party/externals/shaderc2/third_party/spirv-tools/source/valida te_id.cpp',
241 '../third_party/externals/shaderc2/third_party/spirv-tools/source/valida te_instruction.cpp',
242 '../third_party/externals/shaderc2/third_party/spirv-tools/source/valida te_layout.cpp',
243 '../third_party/externals/shaderc2/third_party/spirv-tools/source/valida te_ssa.cpp',
244 '../third_party/externals/shaderc2/third_party/spirv-tools/source/valida te_types.cpp',
245 ],
246 },
247 {
248 'target_name': 'genspirvtools',
55 'type': 'none', 249 'type': 'none',
56 'actions': [ 250 'actions': [
57 { 251 {
58 'action_name': 'compile_shaderc', 252 'action_name': 'produce_glsl-1-0',
59 'inputs': [ 253 'inputs': [
60 '<!@(python find.py ../third_party/externals/shaderc2 "*")', 254 '../third_party/externals/shaderc2/third_party/spirv-tools/utils/gen erate_grammar_tables.py',
61 '../tools/build_shaderc.py', 255 '../third_party/externals/shaderc2/third_party/spirv-tools/source/sp irv-1-0.core.grammar.json',
256 '../third_party/externals/shaderc2/third_party/spirv-tools/source/ex tinst-1-0.glsl.std.450.grammar.json',
62 ], 257 ],
63 'outputs': [ 258 'outputs': [
64 '<(shaderc_lib_full_path)', 259 '../third_party/externals/shaderc2/third_party/spirv-tools/source/g lsl.std.450.insts-1-0.inc',
65 ], 260 ],
66 'action': ['python', '../tools/build_shaderc.py', '-s', '../third_part y/externals/shaderc2', '-o', '<(shaderc_out_path)', '-a', '<(skia_arch_type)', ' -t', '<(shaderc_build_configuration)', '-p', '<(shaderc_project_type)', '-c', '< (android_toolchain)'], 261 'action': [
67 }, 262 'python',
68 ], 263 '../third_party/externals/shaderc2/third_party/spirv-tools/utils/gen erate_grammar_tables.py',
69 'copies': [ 264 '--spirv-core-grammar',
265 '../third_party/externals/shaderc2/third_party/spirv-tools/source/sp irv-1-0.core.grammar.json',
266 '--extinst-glsl-grammar',
267 '../third_party/externals/shaderc2/third_party/spirv-tools/source/ex tinst-1-0.glsl.std.450.grammar.json',
268 '--glsl-insts-output',
269 '../third_party/externals/shaderc2/third_party/spirv-tools/source/gl sl.std.450.insts-1-0.inc',
270 ],
271 },
70 { 272 {
71 'destination': '<(PRODUCT_DIR)', 273 'action_name': 'produce_core_operand-1-0',
72 'files': ['<(shaderc_lib_full_path)'], 274 'inputs': [
73 }, 275 '../third_party/externals/shaderc2/third_party/spirv-tools/utils/gen erate_grammar_tables.py',
74 ], 276 '../third_party/externals/shaderc2/third_party/spirv-tools/source/sp irv-1-0.core.grammar.json',
75 'all_dependent_settings': { 277 ],
76 'link_settings': { 278 'outputs': [
77 'libraries': [ 279 '../third_party/externals/shaderc2/third_party/spirv-tools/source/c ore.insts-1-0.inc',
78 '<(shaderc_lib_name)', 280 '../third_party/externals/shaderc2/third_party/spirv-tools/source/o perand.kinds-1-0.inc',
79 ], 281 ],
80 }, 282 'action': [
81 }, 283 'python',
284 '../third_party/externals/shaderc2/third_party/spirv-tools/utils/gen erate_grammar_tables.py',
285 '--spirv-core-grammar',
286 '../third_party/externals/shaderc2/third_party/spirv-tools/source/sp irv-1-0.core.grammar.json',
287 '--core-insts-output',
288 '../third_party/externals/shaderc2/third_party/spirv-tools/source/co re.insts-1-0.inc',
289 '--operand-kinds-output',
290 '../third_party/externals/shaderc2/third_party/spirv-tools/source/op erand.kinds-1-0.inc'
291 ],
292 },
293 {
294 'action_name': 'produce_core_operand-1-1',
295 'inputs': [
296 '../third_party/externals/shaderc2/third_party/spirv-tools/utils/gen erate_grammar_tables.py',
297 '../third_party/externals/shaderc2/third_party/spirv-tools/source/sp irv-1-1.core.grammar.json',
298 ],
299 'outputs': [
300 '../third_party/externals/shaderc2/third_party/spirv-tools/source/c ore.insts-1-1.inc',
301 '../third_party/externals/shaderc2/third_party/spirv-tools/source/o perand.kinds-1-1.inc',
302 ],
303 'action': [
304 'python',
305 '../third_party/externals/shaderc2/third_party/spirv-tools/utils/gen erate_grammar_tables.py',
306 '--spirv-core-grammar',
307 '../third_party/externals/shaderc2/third_party/spirv-tools/source/sp irv-1-1.core.grammar.json',
308 '--core-insts-output',
309 '../third_party/externals/shaderc2/third_party/spirv-tools/source/co re.insts-1-1.inc',
310 '--operand-kinds-output',
311 '../third_party/externals/shaderc2/third_party/spirv-tools/source/op erand.kinds-1-1.inc'
312 ],
313 },
314 {
315 'action_name': 'produce_opencl-1-0',
316 'inputs': [
317 '../third_party/externals/shaderc2/third_party/spirv-tools/utils/gen erate_grammar_tables.py',
318 '../third_party/externals/shaderc2/third_party/spirv-tools/source/sp irv-1-0.core.grammar.json',
319 '../third_party/externals/shaderc2/third_party/spirv-tools/source/ex tinst-1-0.opencl.std.grammar.json',
320 ],
321 'outputs': [
322 '../third_party/externals/shaderc2/third_party/spirv-tools/source/o pencl.std.insts-1-0.inc',
323 ],
324 'action': [
325 'python',
326 '../third_party/externals/shaderc2/third_party/spirv-tools/utils/gen erate_grammar_tables.py',
327 '--spirv-core-grammar',
328 '../third_party/externals/shaderc2/third_party/spirv-tools/source/sp irv-1-1.core.grammar.json',
329 '--extinst-opencl-grammar',
330 '../third_party/externals/shaderc2/third_party/spirv-tools/source/ex tinst-1-0.opencl.std.grammar.json',
331 '--opencl-insts-output',
332 '../third_party/externals/shaderc2/third_party/spirv-tools/source/op encl.std.insts-1-0.inc'
333 ],
334 },
335 ],
82 }, 336 },
83 ], 337 ],
84 } 338 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698