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