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