Don't crash when SimpleCache index is corrupt.
[chromium-blink-merge.git] / gpu / gpu.gyp
blob687e02a451349efded21998bdd7efd2066e7efd3
1 # Copyright (c) 2012 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.
6   'variables': {
7     'nacl_win64_target': 0,
8   },
9   'includes': [
10     'gpu_common.gypi',
11   ],
12   'targets': [
13     {
14       # Library emulates GLES2 using command_buffers.
15       'target_name': 'gles2_implementation',
16       'type': '<(component)',
17       'dependencies': [
18         '../base/base.gyp:base',
19         '../third_party/khronos/khronos.gyp:khronos_headers',
20         '../ui/gl/gl.gyp:gl',
21         'command_buffer/command_buffer.gyp:gles2_utils',
22         'gles2_cmd_helper',
23       ],
24       'defines': [
25         'GLES2_IMPL_IMPLEMENTATION',
26       ],
27       'sources': [
28         '<@(gles2_implementation_source_files)',
29       ],
30       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
31       'msvs_disabled_warnings': [4267, ],
32     },
33     {
34       # Library emulates GLES2 using command_buffers.
35       'target_name': 'gles2_implementation_client_side_arrays',
36       'type': '<(component)',
37       'defines': [
38         'GLES2_IMPL_IMPLEMENTATION',
39         'GLES2_SUPPORT_CLIENT_SIDE_ARRAYS=1',
40       ],
41       'dependencies': [
42         '../base/base.gyp:base',
43         '../third_party/khronos/khronos.gyp:khronos_headers',
44         '../ui/gl/gl.gyp:gl',
45         'command_buffer/command_buffer.gyp:gles2_utils',
46         'gles2_cmd_helper',
47       ],
48       'sources': [
49         '<@(gles2_implementation_source_files)',
50       ],
51       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
52       'msvs_disabled_warnings': [ 4267, ],
53     },
54     {
55       # Library emulates GLES2 using command_buffers.
56       'target_name': 'gles2_implementation_client_side_arrays_no_check',
57       'type': '<(component)',
58       'defines': [
59         'GLES2_IMPL_IMPLEMENTATION',
60         'GLES2_SUPPORT_CLIENT_SIDE_ARRAYS=1',
61         'GLES2_CONFORMANCE_TESTS=1',
62       ],
63       'dependencies': [
64         '../base/base.gyp:base',
65         '../third_party/khronos/khronos.gyp:khronos_headers',
66         'command_buffer/command_buffer.gyp:gles2_utils',
67         'gles2_cmd_helper',
68       ],
69       'sources': [
70         '<@(gles2_implementation_source_files)',
71       ],
72       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
73       'msvs_disabled_warnings': [ 4267, ],
74     },
75     {
76       # Stub to expose gles2_implemenation in C instead of C++.
77       # so GLES2 C programs can work with no changes.
78       'target_name': 'gles2_c_lib',
79       'type': '<(component)',
80       'dependencies': [
81         '../base/base.gyp:base',
82         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
83         'command_buffer/command_buffer.gyp:gles2_utils',
84         'command_buffer_client',
85         'gles2_implementation',
86       ],
87       'defines': [
88         'GLES2_C_LIB_IMPLEMENTATION',
89       ],
90       'sources': [
91         '<@(gles2_c_lib_source_files)',
92       ],
93       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
94       'msvs_disabled_warnings': [4267, ],
95     },
96     {
97       # Same as gles2_c_lib except with no parameter checking. Required for
98       # OpenGL ES 2.0 conformance tests.
99       'target_name': 'gles2_c_lib_nocheck',
100       'type': '<(component)',
101       'defines': [
102         'GLES2_C_LIB_IMPLEMENTATION',
103         'GLES2_CONFORMANCE_TESTS=1',
104       ],
105       'dependencies': [
106         '../base/base.gyp:base',
107         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
108         'command_buffer/command_buffer.gyp:gles2_utils',
109         'command_buffer_client',
110         'gles2_implementation_client_side_arrays_no_check',
111       ],
112       'sources': [
113         '<@(gles2_c_lib_source_files)',
114       ],
115     },
116     {
117       'target_name': 'gpu_unittests',
118       'type': '<(gtest_target_type)',
119       'dependencies': [
120         '../base/base.gyp:base',
121         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
122         '../testing/gmock.gyp:gmock',
123         '../testing/gtest.gyp:gtest',
124         '<(angle_path)/src/build_angle.gyp:translator_glsl',
125         '../ui/gl/gl.gyp:gl',
126         '../ui/ui.gyp:ui',
127         'command_buffer/command_buffer.gyp:gles2_utils',
128         'command_buffer_client',
129         'command_buffer_common',
130         'command_buffer_service',
131         'gpu',
132         'gpu_unittest_utils',
133         'gles2_implementation_client_side_arrays',
134         'gles2_cmd_helper',
135       ],
136       'defines': [
137         'GLES2_C_LIB_IMPLEMENTATION',
138       ],
139       'sources': [
140         '<@(gles2_c_lib_source_files)',
141         'command_buffer/client/buffer_tracker_unittest.cc',
142         'command_buffer/client/client_test_helper.cc',
143         'command_buffer/client/client_test_helper.h',
144         'command_buffer/client/cmd_buffer_helper_test.cc',
145         'command_buffer/client/fenced_allocator_test.cc',
146         'command_buffer/client/gles2_interface_stub.cc',
147         'command_buffer/client/gles2_interface_stub.h',
148         'command_buffer/client/gles2_implementation_unittest.cc',
149         'command_buffer/client/mapped_memory_unittest.cc',
150         'command_buffer/client/query_tracker_unittest.cc',
151         'command_buffer/client/program_info_manager_unittest.cc',
152         'command_buffer/client/ring_buffer_test.cc',
153         'command_buffer/client/transfer_buffer_unittest.cc',
154         'command_buffer/client/vertex_array_object_manager_unittest.cc',
155         'command_buffer/common/bitfield_helpers_test.cc',
156         'command_buffer/common/command_buffer_mock.cc',
157         'command_buffer/common/command_buffer_mock.h',
158         'command_buffer/common/command_buffer_shared_test.cc',
159         'command_buffer/common/debug_marker_manager_unittest.cc',
160         'command_buffer/common/gles2_cmd_format_test.cc',
161         'command_buffer/common/gles2_cmd_format_test_autogen.h',
162         'command_buffer/common/gles2_cmd_utils_unittest.cc',
163         'command_buffer/common/id_allocator_test.cc',
164         'command_buffer/common/trace_event.h',
165         'command_buffer/common/unittest_main.cc',
166         'command_buffer/service/async_pixel_transfer_delegate_mock.h',
167         'command_buffer/service/async_pixel_transfer_delegate_mock.cc',
168         'command_buffer/service/async_pixel_transfer_manager_mock.h',
169         'command_buffer/service/async_pixel_transfer_manager_mock.cc',
170         'command_buffer/service/buffer_manager_unittest.cc',
171         'command_buffer/service/cmd_parser_test.cc',
172         'command_buffer/service/command_buffer_service_unittest.cc',
173         'command_buffer/service/common_decoder_unittest.cc',
174         'command_buffer/service/context_group_unittest.cc',
175         'command_buffer/service/feature_info_unittest.cc',
176         'command_buffer/service/framebuffer_manager_unittest.cc',
177         'command_buffer/service/gles2_cmd_decoder_unittest.cc',
178         'command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h',
179         'command_buffer/service/gles2_cmd_decoder_unittest_1.cc',
180         'command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h',
181         'command_buffer/service/gles2_cmd_decoder_unittest_2.cc',
182         'command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h',
183         'command_buffer/service/gles2_cmd_decoder_unittest_3.cc',
184         'command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h',
185         'command_buffer/service/gles2_cmd_decoder_unittest_base.cc',
186         'command_buffer/service/gles2_cmd_decoder_unittest_base.h',
187         'command_buffer/service/gl_surface_mock.cc',
188         'command_buffer/service/gl_surface_mock.h',
189         'command_buffer/service/gpu_scheduler_unittest.cc',
190         'command_buffer/service/id_manager_unittest.cc',
191         'command_buffer/service/mailbox_manager_unittest.cc',
192         'command_buffer/service/memory_program_cache_unittest.cc',
193         'command_buffer/service/mocks.cc',
194         'command_buffer/service/mocks.h',
195         'command_buffer/service/program_manager_unittest.cc',
196         'command_buffer/service/query_manager_unittest.cc',
197         'command_buffer/service/renderbuffer_manager_unittest.cc',
198         'command_buffer/service/program_cache_lru_helper_unittest.cc',
199         'command_buffer/service/program_cache_unittest.cc',
200         'command_buffer/service/shader_manager_unittest.cc',
201         'command_buffer/service/shader_translator_unittest.cc',
202         'command_buffer/service/stream_texture_mock.cc',
203         'command_buffer/service/stream_texture_mock.h',
204         'command_buffer/service/stream_texture_manager_mock.cc',
205         'command_buffer/service/stream_texture_manager_mock.h',
206         'command_buffer/service/test_helper.cc',
207         'command_buffer/service/test_helper.h',
208         'command_buffer/service/texture_manager_unittest.cc',
209         'command_buffer/service/transfer_buffer_manager_unittest.cc',
210         'command_buffer/service/vertex_attrib_manager_unittest.cc',
211         'command_buffer/service/vertex_array_manager_unittest.cc',
212         'config/gpu_blacklist_unittest.cc',
213         'config/gpu_control_list_entry_unittest.cc',
214         'config/gpu_control_list_machine_model_info_unittest.cc',
215         'config/gpu_control_list_number_info_unittest.cc',
216         'config/gpu_control_list_os_info_unittest.cc',
217         'config/gpu_control_list_string_info_unittest.cc',
218         'config/gpu_control_list_unittest.cc',
219         'config/gpu_control_list_version_info_unittest.cc',
220         'config/gpu_driver_bug_list_unittest.cc',
221         'config/gpu_info_collector_unittest.cc',
222         'config/gpu_info_unittest.cc',
223         'config/gpu_switching_list_unittest.cc',
224         'config/gpu_test_config_unittest.cc',
225         'config/gpu_test_expectations_parser_unittest.cc',
226         'config/gpu_util_unittest.cc',
227       ],
228       'conditions': [
229         ['OS == "android" and gtest_target_type == "shared_library"', {
230           'dependencies': [
231             '../testing/android/native_test.gyp:native_test_native_code',
232           ],
233         }],
234         # See http://crbug.com/162998#c4 for why this is needed.
235         ['OS=="linux" and linux_use_tcmalloc==1', {
236           'dependencies': [
237             '../base/allocator/allocator.gyp:allocator',
238           ],
239         }],
240       ],
241       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
242       'msvs_disabled_warnings': [ 4267, ],
243     },
244     {
245       'target_name': 'gl_tests',
246       'type': '<(gtest_target_type)',
247       'dependencies': [
248         '../base/base.gyp:base',
249         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
250         '../testing/gmock.gyp:gmock',
251         '../testing/gtest.gyp:gtest',
252         '<(angle_path)/src/build_angle.gyp:translator_glsl',
253         '../ui/ui.gyp:ui',
254         'command_buffer/command_buffer.gyp:gles2_utils',
255         'command_buffer_client',
256         'command_buffer_common',
257         'command_buffer_service',
258         'gpu',
259         'gpu_unittest_utils',
260         'gles2_implementation_client_side_arrays',
261         'gles2_cmd_helper',
262         #'gl_unittests',
263       ],
264       'defines': [
265         'GLES2_C_LIB_IMPLEMENTATION',
266         'GL_GLEXT_PROTOTYPES',
267       ],
268       'sources': [
269         '<@(gles2_c_lib_source_files)',
270         'command_buffer/client/gpu_memory_buffer_mock.cc',
271         'command_buffer/client/gpu_memory_buffer_mock.h',
272         'command_buffer/client/image_factory_mock.cc',
273         'command_buffer/client/image_factory_mock.h',
274         'command_buffer/tests/gl_bind_uniform_location_unittest.cc',
275         'command_buffer/tests/gl_chromium_framebuffer_multisample_unittest.cc',
276         'command_buffer/tests/gl_copy_texture_CHROMIUM_unittest.cc',
277         'command_buffer/tests/gl_depth_texture_unittest.cc',
278         'command_buffer/tests/gl_gpu_memory_buffer_unittests.cc',
279         'command_buffer/tests/gl_lose_context_chromium_unittests.cc',
280         'command_buffer/tests/gl_manager.cc',
281         'command_buffer/tests/gl_manager.h',
282         'command_buffer/tests/gl_pointcoord_unittest.cc',
283         'command_buffer/tests/gl_program_unittests.cc',
284         'command_buffer/tests/gl_query_unittests.cc',
285         'command_buffer/tests/gl_readback_unittests.cc',
286         'command_buffer/tests/gl_shared_resources_unittests.cc',
287         'command_buffer/tests/gl_stream_draw_unittests.cc',
288         'command_buffer/tests/gl_test_utils.cc',
289         'command_buffer/tests/gl_test_utils.h',
290         'command_buffer/tests/gl_tests_main.cc',
291         'command_buffer/tests/gl_texture_mailbox_unittests.cc',
292         'command_buffer/tests/gl_texture_storage_unittests.cc',
293         'command_buffer/tests/gl_unittests.cc',
294         'command_buffer/tests/gl_unittests_android.cc',
295         'command_buffer/tests/gl_virtual_contexts_unittests.cc',
296         'command_buffer/tests/occlusion_query_unittests.cc',
297       ],
298       'conditions': [
299         ['OS == "android" and gtest_target_type == "shared_library"', {
300           'dependencies': [
301             '../testing/android/native_test.gyp:native_test_native_code',
302           ],
303         }],
304       ],
305       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
306       'msvs_disabled_warnings': [ 4267, ],
307     },
308     {
309       'target_name': 'gpu_unittest_utils',
310       'type': 'static_library',
311       'dependencies': [
312         '../testing/gmock.gyp:gmock',
313         '../testing/gtest.gyp:gtest',
314         '../third_party/khronos/khronos.gyp:khronos_headers',
315         '../ui/gl/gl.gyp:gl_unittest_utils',
316         'gpu',
317       ],
318       'include_dirs': [
319         '..',
320       ],
321       'sources': [
322         'command_buffer/service/gles2_cmd_decoder_mock.cc',
323         'command_buffer/service/error_state_mock.cc',
324       ],
325     },
326   ],
327   'conditions': [
328     ['component=="static_library"', {
329       'targets': [
330          {
331           'target_name': 'disk_cache_proto',
332           'type': 'static_library',
333           'sources': [ 'command_buffer/service/disk_cache_proto.proto' ],
334           'variables': {
335             'proto_in_dir': 'command_buffer/service',
336             'proto_out_dir': 'gpu/command_buffer/service',
337           },
338           'includes': [ '../build/protoc.gypi' ],
339         },
340         {
341           'target_name': 'gpu',
342           'type': 'none',
343           'dependencies': [
344             'command_buffer_client',
345             'command_buffer_common',
346             'command_buffer_service',
347             'gles2_cmd_helper',
348             'gpu_config',
349             'gpu_ipc',
350           ],
351           'sources': [
352             'gpu_export.h',
353           ],
354           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
355           'msvs_disabled_warnings': [4267, ],
356         },
357         {
358           'target_name': 'command_buffer_common',
359           'type': 'static_library',
360           'includes': [
361             'command_buffer_common.gypi',
362           ],
363           'dependencies': [
364             '../base/base.gyp:base',
365             'command_buffer/command_buffer.gyp:gles2_utils',
366           ],
367           'export_dependent_settings': [
368             '../base/base.gyp:base',
369           ],
370         },
371         {
372           # Library helps make GLES2 command buffers.
373           'target_name': 'gles2_cmd_helper',
374           'type': 'static_library',
375           'includes': [
376             'gles2_cmd_helper.gypi',
377           ],
378           'dependencies': [
379             'command_buffer_client',
380           ],
381           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
382           'msvs_disabled_warnings': [4267, ],
383         },
384         {
385           'target_name': 'command_buffer_client',
386           'type': 'static_library',
387           'includes': [
388             'command_buffer_client.gypi',
389           ],
390           'dependencies': [
391             'command_buffer_common',
392           ],
393           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
394           'msvs_disabled_warnings': [4267, ],
395         },
396         {
397           'target_name': 'command_buffer_service',
398           'type': 'static_library',
399           'includes': [
400             'command_buffer_service.gypi',
401           ],
402           'dependencies': [
403             'command_buffer_common',
404             'disk_cache_proto',
405           ],
406           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
407           'msvs_disabled_warnings': [4267, ],
408         },
409         {
410           'target_name': 'gpu_ipc',
411           'type': 'static_library',
412           'includes': [
413             'gpu_ipc.gypi',
414           ],
415           'dependencies': [
416             'command_buffer_common',
417           ],
418         },
419         {
420           'target_name': 'gpu_config',
421           'type': 'static_library',
422           'includes': [
423             'gpu_config.gypi',
424           ],
425         },
426       ],
427     },
428     { # component != static_library
429       'targets': [
430          {
431           'target_name': 'disk_cache_proto',
432           'type': 'static_library',
433           'sources': [ 'command_buffer/service/disk_cache_proto.proto' ],
434           'variables': {
435             'proto_in_dir': 'command_buffer/service',
436             'proto_out_dir': 'gpu/command_buffer/service',
437           },
438           'includes': [ '../build/protoc.gypi' ],
439         },
440         {
441           'target_name': 'gpu',
442           'type': 'shared_library',
443           'includes': [
444             'command_buffer_client.gypi',
445             'command_buffer_common.gypi',
446             'command_buffer_service.gypi',
447             'gles2_cmd_helper.gypi',
448             'gpu_config.gypi',
449             'gpu_ipc.gypi',
450           ],
451           'defines': [
452             'GPU_IMPLEMENTATION',
453           ],
454           'sources': [
455             'gpu_export.h',
456           ],
457           'dependencies': [
458             '../base/base.gyp:base',
459             'command_buffer/command_buffer.gyp:gles2_utils',
460             'disk_cache_proto',
461           ],
462           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
463           'msvs_disabled_warnings': [4267, ],
464         },
465         {
466           'target_name': 'command_buffer_common',
467           'type': 'none',
468           'dependencies': [
469             'gpu',
470           ],
471         },
472         {
473           # Library helps make GLES2 command buffers.
474           'target_name': 'gles2_cmd_helper',
475           'type': 'none',
476           'dependencies': [
477             'gpu',
478           ],
479           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
480           'msvs_disabled_warnings': [4267, ],
481         },
482         {
483           'target_name': 'command_buffer_client',
484           'type': 'none',
485           'dependencies': [
486             'gpu',
487           ],
488         },
489         {
490           'target_name': 'command_buffer_service',
491           'type': 'none',
492           'dependencies': [
493             'gpu',
494           ],
495         },
496         {
497           'target_name': 'gpu_ipc',
498           'type': 'none',
499           'dependencies': [
500             'gpu',
501           ],
502         },
503       ],
504     }],
505     ['disable_nacl!=1 and OS=="win" and target_arch=="ia32"', {
506       'targets': [
507         {
508           'target_name': 'gpu_ipc_win64',
509           'type': 'static_library',
510           'variables': {
511             'nacl_win64_target': 1,
512           },
513           'includes': [
514             'gpu_ipc.gypi',
515           ],
516           'dependencies': [
517             '../base/base.gyp:base_nacl_win64',
518             '../ipc/ipc.gyp:ipc_win64',
519           ],
520           'defines': [
521             '<@(nacl_win64_defines)',
522             'GPU_IMPLEMENTATION',
523           ],
524           'configurations': {
525             'Common_Base': {
526               'msvs_target_platform': 'x64',
527             },
528           },
529         },
530       ],
531     }],
532     ['OS == "android" and gtest_target_type == "shared_library"', {
533       'targets': [
534         {
535           'target_name': 'gl_tests_apk',
536           'type': 'none',
537           'dependencies': [
538             'gl_tests',
539           ],
540           'variables': {
541             'test_suite_name': 'gl_tests',
542             'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)gl_tests<(SHARED_LIB_SUFFIX)',
543           },
544           'includes': [
545             '../build/apk_test.gypi',
546           ],
547         },
548       ],
549     }],
550   ],