[Feedback] Use callbacks for FeedbackCollector and use ScreenshotTask
[chromium-blink-merge.git] / third_party / mesa / BUILD.gn
blob2d4ec15e9be3fccb2e16559c429f9891e94fd6be
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import("//build/config/ui.gni")
7 config("mesa_headers_config") {
8   include_dirs = [ "src/include" ]
9   if (use_x11) {
10     defines = [ "MESA_EGL_NO_X11_HEADERS" ]
11   }
14 # This directory contains checked-in files generated from the Mesa build.
15 generated_src_dir = "src/chromium_gensrc"
17 source_set("mesa_headers") {
18   public_configs = [ ":mesa_headers_config" ]
21 # This config must generally be prepended to the configs list so that the Mesa
22 # dirs appear before the system ones on Windows. This is necessary so that
23 # #include "GL/gl.h" means to include Mesa's, not the system's.
24 config("mesa_internal_config") {
25   cflags = []
26   defines = [
27     "MAPI_ABI_HEADER=\"glapi_mapi_tmp_shared.h\"",
28     "PACKAGE_NAME=\"Mesa\"",
29     "PACKAGE_TARNAME=\"mesa\"",
30     "PACKAGE_VERSION=\"9.0.3\"",
31     "PACKAGE_STRING=\"Mesa\ 9.0.3\"",
32     "PACKAGE_BUGREPORT=\"https://bugs.freedesktop.org/enter_bug.cgi\?product=Mesa\"",
33     "PACKAGE_URL=\"\"",
34     "PACKAGE=\"mesa\"",
35     "VERSION=\"9.0.3\"",
36     "STDC_HEADERS=1",
37     "HAVE_SYS_TYPES_H=1",
38     "HAVE_SYS_STAT_H=1",
39     "HAVE_STDLIB_H=1",
40     "HAVE_STRING_H=1",
41     "HAVE_MEMORY_H=1",
42     "HAVE_STRINGS_H=1",
43     "HAVE_INTTYPES_H=1",
44     "HAVE_STDINT_H=1",
45     "HAVE_DLFCN_H=1",
46     "LT_OBJDIR=\".libs/\"",
47     "YYTEXT_POINTER=1",
48     "HAVE_LIBEXPAT=1",
49     "HAVE_LIBXCB_DRI2=1",
50     "FEATURE_GL=1",
51     "MAPI_MODE_GLAPI",
53     #"USE_X86_64_ASM",
54     "IN_DRI_DRIVER",
55     "USE_XCB",
56     "GLX_INDIRECT_RENDERING",
57     "GLX_DIRECT_RENDERING",
58     "USE_EXTERNAL_DXTN_LIB=1",
59     "IN_DRI_DRIVER",
60     "HAVE_ALIAS",
61     "HAVE_MINCORE",
62     "HAVE_LIBUDEV",
63     "_GLAPI_NO_EXPORTS",
64   ]
65   include_dirs = [
66     "src/src/gallium/auxiliary",
67     "src/src/gallium/include",
68     "src/src/glsl",
69     "src/src/glsl/glcpp",
70     "src/src/mapi",
71     "src/src/mapi/glapi",
72     "src/src/mesa",
73     "src/src/mesa/main",
74     "src/include",
75     "$generated_src_dir/mesa/",
76     "$generated_src_dir/mesa/main",
77     "$generated_src_dir/mesa/program",
78     "$generated_src_dir/mesa/glapi",
79   ]
81   if (is_android) {
82     defines += [
83       "__GLIBC__",
84       "_GNU_SOURCE",
85     ]
86   }
88   if (is_linux) {
89     defines += [ "_GNU_SOURCE" ]
90   }
92   if (is_posix) {
93     defines += [
94       "HAVE_DLOPEN",
95       "HAVE_PTHREAD=1",
96       "HAVE_UNISTD_H=1",
97     ]
99     if (!is_android) {
100       defines += [ "HAVE_POSIX_MEMALIGN" ]
101     }
103     if (!is_android && !is_mac) {
104       cflags += [ "-fPIC" ]
105     }
106   }
109 # mesa_internal_config is prepended to the config lists.  Flags that
110 # disable warnings need to be appended instead so that they show up
111 # after flags like -Wall. (gn orders flags on a target before flags from
112 # configs.)
113 config("mesa_internal_warnings") {
114   cflags = []
115   if (is_clang) {
116     cflags += [
117       "-Wno-tautological-constant-out-of-range-compare",
118       "-Wno-mismatched-tags",  # Fixed upstream.
119     ]
120   }
121   if (is_win) {
122     # TODO(scottmg): http://crbug.com/143877 These should be removed if
123     # Mesa is ever rolled and the warnings are fixed.
124     cflags += [
125       "/wd4005",  # Macro defined twice.
126       "/wd4065",  # Switch statement contains 'default' but no 'case' labels.
127       "/wd4090",  # 'Operation' : different 'modifier' qualifiers
128       "/wd4099",  # Type name struct-vs-class doesn't match.
129       "/wd4273",  # Inconsistent DLL linkage.
130       "/wd4291",  # No matching operator delete found for placement new.
131       "/wd4305",  # Truncation from int to float.
132       "/wd4334",  # Result of 32-bit shift implicitly converted to 64 bits.
133       "/wd4345",  # POD-type default initializers.
134     ]
135   }
138 static_library("mesa_libglslcommon") {
139   sources = [
140     "$generated_src_dir/mesa/glcpp-lex.c",
141     "$generated_src_dir/mesa/glcpp-parse.c",
142     "$generated_src_dir/mesa/glcpp-parse.h",
143     "$generated_src_dir/mesa/glsl_lexer.cc",
144     "$generated_src_dir/mesa/glsl_parser.cc",
145     "$generated_src_dir/mesa/main/dispatch.h",
146     "src/src/glsl/ast_expr.cpp",
147     "src/src/glsl/ast_function.cpp",
148     "src/src/glsl/ast_to_hir.cpp",
149     "src/src/glsl/ast_type.cpp",
150     "src/src/glsl/builtin_variables.cpp",
151     "src/src/glsl/glcpp/glcpp.h",
152     "src/src/glsl/glcpp/pp.c",
153     "src/src/glsl/glsl_parser_extras.cpp",
154     "src/src/glsl/glsl_parser_extras.h",
155     "src/src/glsl/glsl_symbol_table.cpp",
156     "src/src/glsl/glsl_symbol_table.h",
157     "src/src/glsl/glsl_types.cpp",
158     "src/src/glsl/glsl_types.h",
159     "src/src/glsl/hir_field_selection.cpp",
160     "src/src/glsl/ir.cpp",
161     "src/src/glsl/ir.h",
162     "src/src/glsl/ir_basic_block.cpp",
163     "src/src/glsl/ir_basic_block.h",
164     "src/src/glsl/ir_builder.cpp",
165     "src/src/glsl/ir_builder.h",
166     "src/src/glsl/ir_clone.cpp",
167     "src/src/glsl/ir_constant_expression.cpp",
168     "src/src/glsl/ir_expression_flattening.cpp",
169     "src/src/glsl/ir_expression_flattening.h",
170     "src/src/glsl/ir_function.cpp",
171     "src/src/glsl/ir_function_can_inline.cpp",
172     "src/src/glsl/ir_function_detect_recursion.cpp",
173     "src/src/glsl/ir_hierarchical_visitor.cpp",
174     "src/src/glsl/ir_hierarchical_visitor.h",
175     "src/src/glsl/ir_hv_accept.cpp",
176     "src/src/glsl/ir_import_prototypes.cpp",
177     "src/src/glsl/ir_print_visitor.cpp",
178     "src/src/glsl/ir_print_visitor.h",
179     "src/src/glsl/ir_reader.cpp",
180     "src/src/glsl/ir_reader.h",
181     "src/src/glsl/ir_rvalue_visitor.cpp",
182     "src/src/glsl/ir_rvalue_visitor.h",
183     "src/src/glsl/ir_set_program_inouts.cpp",
184     "src/src/glsl/ir_validate.cpp",
185     "src/src/glsl/ir_variable_refcount.cpp",
186     "src/src/glsl/ir_variable_refcount.h",
187     "src/src/glsl/link_functions.cpp",
188     "src/src/glsl/link_uniform_initializers.cpp",
189     "src/src/glsl/link_uniforms.cpp",
190     "src/src/glsl/linker.cpp",
191     "src/src/glsl/linker.h",
192     "src/src/glsl/loop_analysis.cpp",
193     "src/src/glsl/loop_analysis.h",
194     "src/src/glsl/loop_controls.cpp",
195     "src/src/glsl/loop_unroll.cpp",
196     "src/src/glsl/lower_clip_distance.cpp",
197     "src/src/glsl/lower_discard.cpp",
198     "src/src/glsl/lower_discard_flow.cpp",
199     "src/src/glsl/lower_if_to_cond_assign.cpp",
200     "src/src/glsl/lower_instructions.cpp",
201     "src/src/glsl/lower_jumps.cpp",
202     "src/src/glsl/lower_mat_op_to_vec.cpp",
203     "src/src/glsl/lower_noise.cpp",
204     "src/src/glsl/lower_output_reads.cpp",
205     "src/src/glsl/lower_texture_projection.cpp",
206     "src/src/glsl/lower_ubo_reference.cpp",
207     "src/src/glsl/lower_variable_index_to_cond_assign.cpp",
208     "src/src/glsl/lower_vec_index_to_cond_assign.cpp",
209     "src/src/glsl/lower_vec_index_to_swizzle.cpp",
210     "src/src/glsl/lower_vector.cpp",
211     "src/src/glsl/opt_algebraic.cpp",
212     "src/src/glsl/opt_array_splitting.cpp",
213     "src/src/glsl/opt_constant_folding.cpp",
214     "src/src/glsl/opt_constant_propagation.cpp",
215     "src/src/glsl/opt_constant_variable.cpp",
216     "src/src/glsl/opt_copy_propagation.cpp",
217     "src/src/glsl/opt_copy_propagation_elements.cpp",
218     "src/src/glsl/opt_dead_code.cpp",
219     "src/src/glsl/opt_dead_code_local.cpp",
220     "src/src/glsl/opt_dead_functions.cpp",
221     "src/src/glsl/opt_function_inlining.cpp",
222     "src/src/glsl/opt_if_simplification.cpp",
223     "src/src/glsl/opt_noop_swizzle.cpp",
224     "src/src/glsl/opt_redundant_jumps.cpp",
225     "src/src/glsl/opt_structure_splitting.cpp",
226     "src/src/glsl/opt_swizzle_swizzle.cpp",
227     "src/src/glsl/opt_tree_grafting.cpp",
228     "src/src/glsl/program.h",
229     "src/src/glsl/ralloc.c",
230     "src/src/glsl/ralloc.h",
231     "src/src/glsl/s_expression.cpp",
232     "src/src/glsl/s_expression.h",
234     # Skipped in the GN build. This file duplicates symbols from errors.c and
235     # happens to link in GYP due to static library link ordering.
236     #"src/src/glsl/standalone_scaffolding.cpp",
237     #"src/src/glsl/standalone_scaffolding.h",
238     "src/src/glsl/strtod.c",
239     "src/src/glsl/strtod.h",
240   ]
242   configs -= [ "//build/config/compiler:chromium_code" ]
243   configs += [ "//build/config/compiler:no_chromium_code" ]
244   previous_configs = configs
245   configs = []
246   configs = [ ":mesa_internal_config" ] + previous_configs +
247             [ ":mesa_internal_warnings" ]
249   if (is_clang) {
250     # Mesa triggers some of these Clang warnings.
251     configs -= [ "//build/config/clang:extra_warnings" ]
252   }
254   deps = [
255     ":mesa_headers",
256   ]
259 static_library("mesa") {
260   sources = [
261     "$generated_src_dir/mesa/builtin_function.cpp",
262     "$generated_src_dir/mesa/enums.c",
263     "$generated_src_dir/mesa/glapi_mapi_tmp_shared.h",
264     "$generated_src_dir/mesa/lex.yy.c",
265     "$generated_src_dir/mesa/program/program_parse.tab.c",
266     "$generated_src_dir/mesa/program/program_parse.tab.h",
267     "src/src/mapi/mapi/entry.c",
268     "src/src/mapi/mapi/entry.h",
269     "src/src/mapi/mapi/mapi_glapi.c",
270     "src/src/mapi/mapi/stub.c",
271     "src/src/mapi/mapi/stub.h",
272     "src/src/mapi/mapi/table.c",
273     "src/src/mapi/mapi/table.h",
274     "src/src/mapi/mapi/u_current.c",
275     "src/src/mapi/mapi/u_current.h",
276     "src/src/mapi/mapi/u_execmem.c",
277     "src/src/mapi/mapi/u_execmem.h",
278     "src/src/mesa/main/accum.c",
279     "src/src/mesa/main/accum.h",
280     "src/src/mesa/main/api_arrayelt.c",
281     "src/src/mesa/main/api_arrayelt.h",
282     "src/src/mesa/main/api_exec.c",
283     "src/src/mesa/main/api_exec.h",
284     "src/src/mesa/main/api_loopback.c",
285     "src/src/mesa/main/api_loopback.h",
286     "src/src/mesa/main/api_validate.c",
287     "src/src/mesa/main/api_validate.h",
288     "src/src/mesa/main/arbprogram.c",
289     "src/src/mesa/main/arbprogram.h",
290     "src/src/mesa/main/arrayobj.c",
291     "src/src/mesa/main/arrayobj.h",
292     "src/src/mesa/main/atifragshader.c",
293     "src/src/mesa/main/atifragshader.h",
294     "src/src/mesa/main/attrib.c",
295     "src/src/mesa/main/attrib.h",
296     "src/src/mesa/main/blend.c",
297     "src/src/mesa/main/blend.h",
298     "src/src/mesa/main/bufferobj.c",
299     "src/src/mesa/main/bufferobj.h",
300     "src/src/mesa/main/buffers.c",
301     "src/src/mesa/main/buffers.h",
302     "src/src/mesa/main/clear.c",
303     "src/src/mesa/main/clear.h",
304     "src/src/mesa/main/clip.c",
305     "src/src/mesa/main/clip.h",
306     "src/src/mesa/main/colortab.c",
307     "src/src/mesa/main/colortab.h",
308     "src/src/mesa/main/condrender.c",
309     "src/src/mesa/main/condrender.h",
310     "src/src/mesa/main/context.c",
311     "src/src/mesa/main/context.h",
312     "src/src/mesa/main/convolve.c",
313     "src/src/mesa/main/convolve.h",
314     "src/src/mesa/main/cpuinfo.c",
315     "src/src/mesa/main/cpuinfo.h",
316     "src/src/mesa/main/debug.c",
317     "src/src/mesa/main/debug.h",
318     "src/src/mesa/main/depth.c",
319     "src/src/mesa/main/depth.h",
320     "src/src/mesa/main/dlist.c",
321     "src/src/mesa/main/dlist.h",
322     "src/src/mesa/main/drawpix.c",
323     "src/src/mesa/main/drawpix.h",
324     "src/src/mesa/main/drawtex.c",
325     "src/src/mesa/main/drawtex.h",
326     "src/src/mesa/main/enable.c",
327     "src/src/mesa/main/enable.h",
328     "src/src/mesa/main/enums.h",
329     "src/src/mesa/main/errors.c",
330     "src/src/mesa/main/errors.h",
331     "src/src/mesa/main/eval.c",
332     "src/src/mesa/main/eval.h",
333     "src/src/mesa/main/execmem.c",
334     "src/src/mesa/main/extensions.c",
335     "src/src/mesa/main/extensions.h",
336     "src/src/mesa/main/fbobject.c",
337     "src/src/mesa/main/fbobject.h",
338     "src/src/mesa/main/feedback.c",
339     "src/src/mesa/main/feedback.h",
340     "src/src/mesa/main/ff_fragment_shader.cpp",
341     "src/src/mesa/main/ffvertex_prog.c",
342     "src/src/mesa/main/ffvertex_prog.h",
343     "src/src/mesa/main/fog.c",
344     "src/src/mesa/main/fog.h",
345     "src/src/mesa/main/format_pack.c",
346     "src/src/mesa/main/format_pack.h",
347     "src/src/mesa/main/format_unpack.c",
348     "src/src/mesa/main/format_unpack.h",
349     "src/src/mesa/main/formats.c",
350     "src/src/mesa/main/formats.h",
351     "src/src/mesa/main/framebuffer.c",
352     "src/src/mesa/main/framebuffer.h",
353     "src/src/mesa/main/get.c",
354     "src/src/mesa/main/get.h",
355     "src/src/mesa/main/getstring.c",
356     "src/src/mesa/main/glformats.c",
357     "src/src/mesa/main/glformats.h",
358     "src/src/mesa/main/hash.c",
359     "src/src/mesa/main/hash.h",
360     "src/src/mesa/main/hint.c",
361     "src/src/mesa/main/hint.h",
362     "src/src/mesa/main/histogram.c",
363     "src/src/mesa/main/histogram.h",
364     "src/src/mesa/main/image.c",
365     "src/src/mesa/main/image.h",
366     "src/src/mesa/main/imports.c",
367     "src/src/mesa/main/imports.h",
368     "src/src/mesa/main/light.c",
369     "src/src/mesa/main/light.h",
370     "src/src/mesa/main/lines.c",
371     "src/src/mesa/main/lines.h",
372     "src/src/mesa/main/matrix.c",
373     "src/src/mesa/main/matrix.h",
374     "src/src/mesa/main/mipmap.c",
375     "src/src/mesa/main/mipmap.h",
376     "src/src/mesa/main/mm.c",
377     "src/src/mesa/main/mm.h",
378     "src/src/mesa/main/multisample.c",
379     "src/src/mesa/main/multisample.h",
380     "src/src/mesa/main/nvprogram.c",
381     "src/src/mesa/main/nvprogram.h",
382     "src/src/mesa/main/pack.c",
383     "src/src/mesa/main/pack.h",
384     "src/src/mesa/main/pbo.c",
385     "src/src/mesa/main/pbo.h",
386     "src/src/mesa/main/pixel.c",
387     "src/src/mesa/main/pixel.h",
388     "src/src/mesa/main/pixelstore.c",
389     "src/src/mesa/main/pixelstore.h",
390     "src/src/mesa/main/pixeltransfer.c",
391     "src/src/mesa/main/pixeltransfer.h",
392     "src/src/mesa/main/points.c",
393     "src/src/mesa/main/points.h",
394     "src/src/mesa/main/polygon.c",
395     "src/src/mesa/main/polygon.h",
396     "src/src/mesa/main/queryobj.c",
397     "src/src/mesa/main/queryobj.h",
398     "src/src/mesa/main/rastpos.c",
399     "src/src/mesa/main/rastpos.h",
400     "src/src/mesa/main/readpix.c",
401     "src/src/mesa/main/readpix.h",
402     "src/src/mesa/main/remap.c",
403     "src/src/mesa/main/remap.h",
404     "src/src/mesa/main/renderbuffer.c",
405     "src/src/mesa/main/renderbuffer.h",
406     "src/src/mesa/main/samplerobj.c",
407     "src/src/mesa/main/samplerobj.h",
408     "src/src/mesa/main/scissor.c",
409     "src/src/mesa/main/scissor.h",
410     "src/src/mesa/main/shader_query.cpp",
411     "src/src/mesa/main/shaderapi.c",
412     "src/src/mesa/main/shaderapi.h",
413     "src/src/mesa/main/shaderobj.c",
414     "src/src/mesa/main/shaderobj.h",
415     "src/src/mesa/main/shared.c",
416     "src/src/mesa/main/shared.h",
417     "src/src/mesa/main/state.c",
418     "src/src/mesa/main/state.h",
419     "src/src/mesa/main/stencil.c",
420     "src/src/mesa/main/stencil.h",
421     "src/src/mesa/main/syncobj.c",
422     "src/src/mesa/main/syncobj.h",
423     "src/src/mesa/main/texcompress.c",
424     "src/src/mesa/main/texcompress.h",
425     "src/src/mesa/main/texcompress_cpal.c",
426     "src/src/mesa/main/texcompress_cpal.h",
427     "src/src/mesa/main/texcompress_etc.c",
428     "src/src/mesa/main/texcompress_etc.h",
429     "src/src/mesa/main/texcompress_fxt1.c",
430     "src/src/mesa/main/texcompress_fxt1.h",
431     "src/src/mesa/main/texcompress_rgtc.c",
432     "src/src/mesa/main/texcompress_rgtc.h",
433     "src/src/mesa/main/texcompress_s3tc.c",
434     "src/src/mesa/main/texcompress_s3tc.h",
435     "src/src/mesa/main/texenv.c",
436     "src/src/mesa/main/texenv.h",
437     "src/src/mesa/main/texformat.c",
438     "src/src/mesa/main/texformat.h",
439     "src/src/mesa/main/texgen.c",
440     "src/src/mesa/main/texgen.h",
441     "src/src/mesa/main/texgetimage.c",
442     "src/src/mesa/main/texgetimage.h",
443     "src/src/mesa/main/teximage.c",
444     "src/src/mesa/main/teximage.h",
445     "src/src/mesa/main/texobj.c",
446     "src/src/mesa/main/texobj.h",
447     "src/src/mesa/main/texparam.c",
448     "src/src/mesa/main/texparam.h",
449     "src/src/mesa/main/texstate.c",
450     "src/src/mesa/main/texstate.h",
451     "src/src/mesa/main/texstorage.c",
452     "src/src/mesa/main/texstorage.h",
453     "src/src/mesa/main/texstore.c",
454     "src/src/mesa/main/texstore.h",
455     "src/src/mesa/main/texturebarrier.c",
456     "src/src/mesa/main/texturebarrier.h",
457     "src/src/mesa/main/transformfeedback.c",
458     "src/src/mesa/main/transformfeedback.h",
459     "src/src/mesa/main/uniform_query.cpp",
460     "src/src/mesa/main/uniforms.c",
461     "src/src/mesa/main/uniforms.h",
462     "src/src/mesa/main/varray.c",
463     "src/src/mesa/main/varray.h",
464     "src/src/mesa/main/version.c",
465     "src/src/mesa/main/version.h",
466     "src/src/mesa/main/viewport.c",
467     "src/src/mesa/main/viewport.h",
468     "src/src/mesa/main/vtxfmt.c",
469     "src/src/mesa/main/vtxfmt.h",
470     "src/src/mesa/math/m_debug_clip.c",
471     "src/src/mesa/math/m_debug_norm.c",
472     "src/src/mesa/math/m_debug_xform.c",
473     "src/src/mesa/math/m_eval.c",
474     "src/src/mesa/math/m_eval.h",
475     "src/src/mesa/math/m_matrix.c",
476     "src/src/mesa/math/m_matrix.h",
477     "src/src/mesa/math/m_translate.c",
478     "src/src/mesa/math/m_translate.h",
479     "src/src/mesa/math/m_vector.c",
480     "src/src/mesa/math/m_vector.h",
481     "src/src/mesa/math/m_xform.c",
482     "src/src/mesa/math/m_xform.h",
483     "src/src/mesa/program/arbprogparse.c",
484     "src/src/mesa/program/arbprogparse.h",
485     "src/src/mesa/program/hash_table.c",
486     "src/src/mesa/program/hash_table.h",
487     "src/src/mesa/program/ir_to_mesa.cpp",
488     "src/src/mesa/program/ir_to_mesa.h",
489     "src/src/mesa/program/nvfragparse.c",
490     "src/src/mesa/program/nvfragparse.h",
491     "src/src/mesa/program/nvvertparse.c",
492     "src/src/mesa/program/nvvertparse.h",
493     "src/src/mesa/program/prog_cache.c",
494     "src/src/mesa/program/prog_cache.h",
495     "src/src/mesa/program/prog_execute.c",
496     "src/src/mesa/program/prog_execute.h",
497     "src/src/mesa/program/prog_instruction.c",
498     "src/src/mesa/program/prog_instruction.h",
499     "src/src/mesa/program/prog_noise.c",
500     "src/src/mesa/program/prog_noise.h",
501     "src/src/mesa/program/prog_opt_constant_fold.c",
502     "src/src/mesa/program/prog_optimize.c",
503     "src/src/mesa/program/prog_optimize.h",
504     "src/src/mesa/program/prog_parameter.c",
505     "src/src/mesa/program/prog_parameter.h",
506     "src/src/mesa/program/prog_parameter_layout.c",
507     "src/src/mesa/program/prog_parameter_layout.h",
508     "src/src/mesa/program/prog_print.c",
509     "src/src/mesa/program/prog_print.h",
510     "src/src/mesa/program/prog_statevars.c",
511     "src/src/mesa/program/prog_statevars.h",
512     "src/src/mesa/program/program.c",
513     "src/src/mesa/program/program.h",
514     "src/src/mesa/program/program_parse_extra.c",
515     "src/src/mesa/program/programopt.c",
516     "src/src/mesa/program/programopt.h",
517     "src/src/mesa/program/register_allocate.c",
518     "src/src/mesa/program/register_allocate.h",
519     "src/src/mesa/program/sampler.cpp",
520     "src/src/mesa/program/sampler.h",
521     "src/src/mesa/program/string_to_uint_map.cpp",
522     "src/src/mesa/program/symbol_table.c",
523     "src/src/mesa/program/symbol_table.h",
524     "src/src/mesa/swrast/s_aaline.c",
525     "src/src/mesa/swrast/s_aaline.h",
526     "src/src/mesa/swrast/s_aatriangle.c",
527     "src/src/mesa/swrast/s_aatriangle.h",
528     "src/src/mesa/swrast/s_alpha.c",
529     "src/src/mesa/swrast/s_alpha.h",
530     "src/src/mesa/swrast/s_atifragshader.c",
531     "src/src/mesa/swrast/s_atifragshader.h",
532     "src/src/mesa/swrast/s_bitmap.c",
533     "src/src/mesa/swrast/s_blend.c",
534     "src/src/mesa/swrast/s_blend.h",
535     "src/src/mesa/swrast/s_blit.c",
536     "src/src/mesa/swrast/s_clear.c",
537     "src/src/mesa/swrast/s_context.c",
538     "src/src/mesa/swrast/s_context.h",
539     "src/src/mesa/swrast/s_copypix.c",
540     "src/src/mesa/swrast/s_depth.c",
541     "src/src/mesa/swrast/s_depth.h",
542     "src/src/mesa/swrast/s_drawpix.c",
543     "src/src/mesa/swrast/s_feedback.c",
544     "src/src/mesa/swrast/s_feedback.h",
545     "src/src/mesa/swrast/s_fog.c",
546     "src/src/mesa/swrast/s_fog.h",
547     "src/src/mesa/swrast/s_fragprog.c",
548     "src/src/mesa/swrast/s_fragprog.h",
549     "src/src/mesa/swrast/s_lines.c",
550     "src/src/mesa/swrast/s_lines.h",
551     "src/src/mesa/swrast/s_logic.c",
552     "src/src/mesa/swrast/s_logic.h",
553     "src/src/mesa/swrast/s_masking.c",
554     "src/src/mesa/swrast/s_masking.h",
555     "src/src/mesa/swrast/s_points.c",
556     "src/src/mesa/swrast/s_points.h",
557     "src/src/mesa/swrast/s_renderbuffer.c",
558     "src/src/mesa/swrast/s_renderbuffer.h",
559     "src/src/mesa/swrast/s_span.c",
560     "src/src/mesa/swrast/s_span.h",
561     "src/src/mesa/swrast/s_stencil.c",
562     "src/src/mesa/swrast/s_stencil.h",
563     "src/src/mesa/swrast/s_texcombine.c",
564     "src/src/mesa/swrast/s_texcombine.h",
565     "src/src/mesa/swrast/s_texfetch.c",
566     "src/src/mesa/swrast/s_texfetch.h",
567     "src/src/mesa/swrast/s_texfilter.c",
568     "src/src/mesa/swrast/s_texfilter.h",
569     "src/src/mesa/swrast/s_texrender.c",
570     "src/src/mesa/swrast/s_texture.c",
571     "src/src/mesa/swrast/s_triangle.c",
572     "src/src/mesa/swrast/s_triangle.h",
573     "src/src/mesa/swrast/s_zoom.c",
574     "src/src/mesa/swrast/s_zoom.h",
575     "src/src/mesa/swrast_setup/ss_context.c",
576     "src/src/mesa/swrast_setup/ss_context.h",
577     "src/src/mesa/swrast_setup/ss_triangle.c",
578     "src/src/mesa/swrast_setup/ss_triangle.h",
579     "src/src/mesa/tnl/t_context.c",
580     "src/src/mesa/tnl/t_context.h",
581     "src/src/mesa/tnl/t_draw.c",
582     "src/src/mesa/tnl/t_pipeline.c",
583     "src/src/mesa/tnl/t_pipeline.h",
584     "src/src/mesa/tnl/t_rasterpos.c",
585     "src/src/mesa/tnl/t_vb_fog.c",
586     "src/src/mesa/tnl/t_vb_light.c",
587     "src/src/mesa/tnl/t_vb_normals.c",
588     "src/src/mesa/tnl/t_vb_points.c",
589     "src/src/mesa/tnl/t_vb_program.c",
590     "src/src/mesa/tnl/t_vb_render.c",
591     "src/src/mesa/tnl/t_vb_texgen.c",
592     "src/src/mesa/tnl/t_vb_texmat.c",
593     "src/src/mesa/tnl/t_vb_vertex.c",
594     "src/src/mesa/tnl/t_vertex.c",
595     "src/src/mesa/tnl/t_vertex.h",
596     "src/src/mesa/tnl/t_vertex_generic.c",
597     "src/src/mesa/tnl/t_vertex_sse.c",
598     "src/src/mesa/tnl/t_vp_build.c",
599     "src/src/mesa/tnl/t_vp_build.h",
600     "src/src/mesa/vbo/vbo_context.c",
601     "src/src/mesa/vbo/vbo_context.h",
602     "src/src/mesa/vbo/vbo_exec.c",
603     "src/src/mesa/vbo/vbo_exec.h",
604     "src/src/mesa/vbo/vbo_exec_api.c",
605     "src/src/mesa/vbo/vbo_exec_array.c",
606     "src/src/mesa/vbo/vbo_exec_draw.c",
607     "src/src/mesa/vbo/vbo_exec_eval.c",
608     "src/src/mesa/vbo/vbo_noop.c",
609     "src/src/mesa/vbo/vbo_noop.h",
610     "src/src/mesa/vbo/vbo_primitive_restart.c",
611     "src/src/mesa/vbo/vbo_rebase.c",
612     "src/src/mesa/vbo/vbo_save.c",
613     "src/src/mesa/vbo/vbo_save.h",
614     "src/src/mesa/vbo/vbo_save_api.c",
615     "src/src/mesa/vbo/vbo_save_draw.c",
616     "src/src/mesa/vbo/vbo_save_loopback.c",
617     "src/src/mesa/vbo/vbo_split.c",
618     "src/src/mesa/vbo/vbo_split.h",
619     "src/src/mesa/vbo/vbo_split_copy.c",
620     "src/src/mesa/vbo/vbo_split_inplace.c",
621     "src/src/mesa/x86-64/x86-64.c",
622     "src/src/mesa/x86-64/x86-64.h",
623   ]
625   configs -= [ "//build/config/compiler:chromium_code" ]
626   configs += [ "//build/config/compiler:no_chromium_code" ]
627   previous_configs = configs
628   configs = []
629   configs = [ ":mesa_internal_config" ] + previous_configs +
630             [ ":mesa_internal_warnings" ]
632   if (is_clang) {
633     # Mesa triggers some of these Clang warnings.
634     configs -= [ "//build/config/clang:extra_warnings" ]
635   }
637   cflags = []
639   if (is_android && !is_clang) {
640     # Disable sincos() optimization to avoid a linker error
641     # since Android's math library doesn't have sincos().
642     # Either -fno-builtin-sin or -fno-builtin-cos works.
643     cflags += [ "-fno-builtin-sin" ]
644   }
646   if (is_win) {
647     # Because we're building as a static library
648     defines = [ "_GLAPI_NO_EXPORTS" ]
649   }
651   deps = [
652     ":mesa_headers",
653   ]
656 if (!is_android) {  # TODO(GYP) enable for Android.
657   # Building this target will hide the native OpenGL shared library and
658   # replace it with a slow software renderer.
659   # TODO(GYP) http://crbug.com/380327 need support for loadable_module.
660   #loadable_module("osmesa") {
661   shared_library("osmesa") {
662     sources = [
663       "src/src/mesa/drivers/common/driverfuncs.c",
664       "src/src/mesa/drivers/common/driverfuncs.h",
665       "src/src/mesa/drivers/common/meta.c",
666       "src/src/mesa/drivers/common/meta.h",
667       "src/src/mesa/drivers/osmesa/osmesa.c",
668     ]
670     configs -= [ "//build/config/compiler:chromium_code" ]
671     configs += [
672       ":mesa_headers_config",
673       "//build/config/compiler:no_chromium_code",
674     ]
675     previous_configs = configs
676     configs = []
677     configs = [ ":mesa_internal_config" ] + previous_configs +
678               [ ":mesa_internal_warnings" ]
680     include_dirs = [ "src/src/mesa/drivers" ]
682     if (is_clang) {
683       # Mesa triggers some of these Clang warnings.
684       configs -= [ "//build/config/clang:extra_warnings" ]
685     }
687     if (is_win) {
688       ldflags =
689           [ "/DEF:" + rebase_path("src/src/mesa/drivers/osmesa/osmesa.def",
690                                   root_build_dir) ]
691     }
693     deps = [
694       ":mesa_headers",
695       ":mesa",
696       ":mesa_libglslcommon",
697     ]
699     if (is_win) {
700       defines = [
701         "BUILD_GL32",
702         "KEYWORD1=GLAPI",
703         "KEYWORD2=GLAPIENTRY",
704       ]
705     }
706   }
707 } else {
708   #  Placeholder to allow targets to unconditionally depend on this.
709   group("osmesa") {
710   }
711 }  # !is_android
712 # TODO(GYP) Android osmesa_in_lib_dir target.