Landing revision 47182 again: Added dependency on ANGLE for all platforms now that...
[chromium-blink-merge.git] / gpu / gpu.gyp
blobb52d1fe2a4c00a5bcc96bfbd13e84ea60e8258c9
1 # Copyright (c) 2009 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     'chromium_code': 1,
8     # This is defined here because we need to compile this set of files
9     # twice with different defines. Once so it calls real GL, again so it
10     # calls mock GL for the unit tests.
11     'gpu_service_source_files': [
12       'command_buffer/service/buffer_manager.h',
13       'command_buffer/service/buffer_manager.cc',
14       'command_buffer/service/framebuffer_manager.h',
15       'command_buffer/service/framebuffer_manager.cc',
16       'command_buffer/service/context_group.h',
17       'command_buffer/service/context_group.cc',
18       'command_buffer/service/gles2_cmd_decoder.h',
19       'command_buffer/service/gles2_cmd_decoder_autogen.h',
20       'command_buffer/service/gles2_cmd_decoder.cc',
21       'command_buffer/service/gles2_cmd_validation.h',
22       'command_buffer/service/gles2_cmd_validation.cc',
23       'command_buffer/service/gles2_cmd_validation_autogen.h',
24       'command_buffer/service/gles2_cmd_validation_implementation_autogen.h',
25       'command_buffer/service/gl_utils.h',
26       'command_buffer/service/gpu_processor.h',
27       'command_buffer/service/gpu_processor.cc',
28       'command_buffer/service/gpu_processor_linux.cc',
29       'command_buffer/service/gpu_processor_mac.cc',
30       'command_buffer/service/gpu_processor_win.cc',
31       'command_buffer/service/gpu_processor_mock.h',
32       'command_buffer/service/id_manager.h',
33       'command_buffer/service/id_manager.cc',
34       'command_buffer/service/program_manager.h',
35       'command_buffer/service/program_manager.cc',
36       'command_buffer/service/renderbuffer_manager.h',
37       'command_buffer/service/renderbuffer_manager.cc',
38       'command_buffer/service/shader_manager.h',
39       'command_buffer/service/shader_manager.cc',
40       'command_buffer/service/texture_manager.h',
41       'command_buffer/service/texture_manager.cc',
42     ],
43     'enable_shader_translation%': 0,
44   },
45   'targets': [
46     {
47       'target_name': 'gl_libs',
48       'type': 'static_library',
49         'include_dirs': [
50           '../third_party/glew/include',
51         ],
52         'defines': [
53           'GLEW_STATIC',
54         ],
55       'all_dependent_settings': {
56         'include_dirs': [
57           '../third_party/glew/include',
58         ],
59         'defines': [
60           'GLEW_STATIC',
61         ],
62       },
63       'sources': [
64         '../third_party/glew/src/glew.c',
65       ],
66       'conditions': [
67         [ 'OS=="linux"',
68           {
69             'all_dependent_settings': {
70               'defines': [
71                 'GL_GLEXT_PROTOTYPES',
72               ],
73               'ldflags': [
74                 '-L<(PRODUCT_DIR)',
75               ],
76               'link_settings': {
77                 'libraries': [
78                   '-lX11',
79                   # For dlsym() in '../third_party/glew/src/glew.c'
80                   '-ldl',
81                 ],
82               },
83             },
84           },
85         ],
86         [ 'OS=="mac"',
87           {
88             'link_settings': {
89               'libraries': [
90                 '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
91               ],
92             },
93           },
94         ],
95         [ 'OS=="win"',
96           {
97             'all_dependent_settings': {
98               'link_settings': {
99                 'libraries': [
100                   '-lOpenGL32.lib',
101                 ],
102               },
103             },
104           },
105         ],
106       ],
107     },
108     {
109       'target_name': 'command_buffer_common',
110       'type': 'static_library',
111       'include_dirs': [
112         '.',
113         '..',
114       ],
115       'all_dependent_settings': {
116         'include_dirs': [
117           '.',
118           '..',
119         ],
120       },
121       'dependencies': [
122         '../base/base.gyp:base',
123       ],
124       'sources': [
125         'command_buffer/common/bitfield_helpers.h',
126         'command_buffer/common/buffer.h',
127         'command_buffer/common/cmd_buffer_common.h',
128         'command_buffer/common/cmd_buffer_common.cc',
129         'command_buffer/common/command_buffer.h',
130         'command_buffer/common/command_buffer_mock.h',
131         'command_buffer/common/constants.h',
132         'command_buffer/common/gles2_cmd_ids_autogen.h',
133         'command_buffer/common/gles2_cmd_ids.h',
134         'command_buffer/common/gles2_cmd_format_autogen.h',
135         'command_buffer/common/gles2_cmd_format.cc',
136         'command_buffer/common/gles2_cmd_format.h',
137         'command_buffer/common/gles2_cmd_utils.cc',
138         'command_buffer/common/gles2_cmd_utils.h',
139         'command_buffer/common/id_allocator.cc',
140         'command_buffer/common/id_allocator.h',
141         'command_buffer/common/logging.h',
142         'command_buffer/common/mocks.h',
143         'command_buffer/common/thread_local.h',
144         'command_buffer/common/types.h',
145       ],
146     },
147     {
148       # Library helps make GLES2 command buffers.
149       'target_name': 'gles2_cmd_helper',
150       'type': 'static_library',
151       'dependencies': [
152         'command_buffer_client',
153       ],
154       'sources': [
155         'command_buffer/client/gles2_cmd_helper.cc',
156         'command_buffer/client/gles2_cmd_helper.h',
157         'command_buffer/client/gles2_cmd_helper_autogen.h',
158       ],
159     },
160     {
161       # Library emulates GLES2 using command_buffers.
162       'target_name': 'gles2_implementation',
163       'type': 'static_library',
164       'dependencies': [
165         'gles2_cmd_helper',
166       ],
167       'all_dependent_settings': {
168         'include_dirs': [
169           # For GLES2/gl2.h
170           '.',
171         ],
172       },
173       'sources': [
174         'command_buffer/client/gles2_implementation_autogen.h',
175         'command_buffer/client/gles2_implementation.cc',
176         'command_buffer/client/gles2_implementation.h',
177       ],
178     },
179     {
180       # Stub to expose gles2_implementation as a namespace rather than a class
181       # so GLES2 C++ programs can work with no changes.
182       'target_name': 'gles2_lib',
183       'type': 'static_library',
184       'dependencies': [
185         'gles2_implementation',
186       ],
187       'sources': [
188         'command_buffer/client/gles2_lib.cc',
189         'command_buffer/client/gles2_lib.h',
190       ],
191     },
192     {
193       # Stub to expose gles2_implemenation in C instead of C++.
194       # so GLES2 C programs can work with no changes.
195       'target_name': 'gles2_c_lib',
196       'type': 'static_library',
197       'dependencies': [
198         'gles2_lib',
199       ],
200       'sources': [
201         'command_buffer/client/gles2_c_lib.h',
202         'command_buffer/client/gles2_c_lib.cc',
203         'command_buffer/client/gles2_c_lib_autogen.h',
204       ],
205     },
206     {
207       'target_name': 'command_buffer_client',
208       'type': 'static_library',
209       'dependencies': [
210         'command_buffer_common',
211       ],
212       'sources': [
213         'command_buffer/client/cmd_buffer_helper.cc',
214         'command_buffer/client/cmd_buffer_helper.h',
215         'command_buffer/client/fenced_allocator.cc',
216         'command_buffer/client/fenced_allocator.h',
217         'command_buffer/client/ring_buffer.cc',
218         'command_buffer/client/ring_buffer.h',
219       ],
220     },
221     {
222       'target_name': 'command_buffer_service_impl',
223       'type': 'static_library',
224       'include_dirs': [
225         '..',
226       ],
227       'all_dependent_settings': {
228         'include_dirs': [
229           '..',
230         ],
231       },
232       'dependencies': [
233         'command_buffer_common',
234         'gl_libs',
235         '../gfx/gfx.gyp:gfx',
236       ],
237       'sources': [
238         'command_buffer/service/common_decoder.cc',
239         'command_buffer/service/common_decoder.h',
240         'command_buffer/service/cmd_buffer_engine.h',
241         'command_buffer/service/command_buffer_service.cc',
242         'command_buffer/service/command_buffer_service.h',
243         'command_buffer/service/cmd_parser.cc',
244         'command_buffer/service/cmd_parser.h',
245         'command_buffer/service/mocks.h',
246       ],
247     },
248     {
249       'target_name': 'command_buffer_service',
250       'type': 'static_library',
251       'include_dirs': [
252         '..',
253       ],
254       'all_dependent_settings': {
255         'include_dirs': [
256           '..',
257         ],
258       },
259       'dependencies': [
260         'command_buffer_service_impl',
261         'gl_libs',
262         '../app/app.gyp:app_base',
263       ],
264       'sources': [
265         '<@(gpu_service_source_files)',
266       ],
267       'conditions': [
268         ['OS == "linux"', {
269           'dependencies': [
270             '../build/linux/system.gyp:gtk',
271           ],
272         }],
273         ['enable_shader_translation==1', {
274           'defines': [
275             'GLES2_GPU_SERVICE_TRANSLATE_SHADER',
276           ],
277           'dependencies': [
278             '../third_party/angle/src/build_angle.gyp:translator_glsl',
279           ],
280         }],
281       ],
282     },
283     {
284       'target_name': 'gpu_plugin',
285       'type': 'static_library',
286       'dependencies': [
287         '../base/base.gyp:base',
288         'command_buffer_service',
289       ],
290       'include_dirs': [
291         '..',
292       ],
293       'all_dependent_settings': {
294         'include_dirs': [
295           '..',
296         ],
297       },
298       'sources': [
299         'gpu_plugin/gpu_plugin.cc',
300         'gpu_plugin/gpu_plugin.h',
301       ],
302     },
303     {
304       'target_name': 'gpu_unittests',
305       'type': 'executable',
306       'dependencies': [
307         '../testing/gmock.gyp:gmock',
308         '../testing/gmock.gyp:gmockmain',
309         '../testing/gtest.gyp:gtest',
310         'command_buffer_client',
311         'command_buffer_common',
312         'command_buffer_service_impl',
313         'gles2_lib',
314         'gles2_implementation',
315         'gles2_cmd_helper',
316       ],
317       'sources': [
318         '<@(gpu_service_source_files)',
319         'command_buffer/client/cmd_buffer_helper_test.cc',
320         'command_buffer/client/fenced_allocator_test.cc',
321         'command_buffer/client/gles2_implementation_unittest.cc',
322         'command_buffer/client/ring_buffer_test.cc',
323         'command_buffer/common/bitfield_helpers_test.cc',
324         'command_buffer/common/gles2_cmd_format_test.cc',
325         'command_buffer/common/gles2_cmd_format_test_autogen.h',
326         'command_buffer/common/gles2_cmd_id_test.cc',
327         'command_buffer/common/gles2_cmd_id_test_autogen.h',
328         'command_buffer/common/gles2_cmd_format_test.cc',
329         'command_buffer/common/gles2_cmd_format_test_autogen.h',
330         'command_buffer/common/gles2_cmd_id_test.cc',
331         'command_buffer/common/gles2_cmd_id_test_autogen.h',
332         'command_buffer/common/gles2_cmd_format_test.cc',
333         'command_buffer/common/gles2_cmd_format_test_autogen.h',
334         'command_buffer/common/gles2_cmd_id_test.cc',
335         'command_buffer/common/gles2_cmd_id_test_autogen.h',
336         'command_buffer/common/id_allocator_test.cc',
337         'command_buffer/service/buffer_manager_unittest.cc',
338         'command_buffer/service/context_group_unittest.cc',
339         'command_buffer/service/cmd_parser_test.cc',
340         'command_buffer/service/cmd_parser_test.cc',
341         'command_buffer/service/common_decoder_unittest.cc',
342         'command_buffer/service/framebuffer_manager_unittest.cc',
343         'command_buffer/service/gpu_processor_unittest.cc',
344         'command_buffer/service/gl_context_stub.cc',
345         'command_buffer/service/gl_interface.h',
346         'command_buffer/service/gl_interface.cc',
347         'command_buffer/service/gl_mock.h',
348         'command_buffer/service/gl_mock.cc',
349         'command_buffer/service/gles2_cmd_decoder_unittest_base.h',
350         'command_buffer/service/gles2_cmd_decoder_unittest_base.cc',
351         'command_buffer/service/gles2_cmd_decoder_unittest.cc',
352         'command_buffer/service/gles2_cmd_decoder_unittest_1.cc',
353         'command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h',
354         'command_buffer/service/gles2_cmd_decoder_unittest_2.cc',
355         'command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h',
356         'command_buffer/service/id_manager_unittest.cc',
357         'command_buffer/service/program_manager_unittest.cc',
358         'command_buffer/service/renderbuffer_manager_unittest.cc',
359         'command_buffer/service/shader_manager_unittest.cc',
360         'command_buffer/service/texture_manager_unittest.cc',
361       ],
362     },
363     {
364       'target_name': 'gles2_demo_lib',
365       'type': 'static_library',
366       'dependencies': [
367         'command_buffer_client',
368         'gles2_lib',
369         'gles2_c_lib',
370       ],
371       'sources': [
372         'command_buffer/client/gles2_demo_c.h',
373         'command_buffer/client/gles2_demo_c.c',
374         'command_buffer/client/gles2_demo_cc.h',
375         'command_buffer/client/gles2_demo_cc.cc',
376       ],
377     },
378     {
379       'target_name': 'pgl',
380       'type': 'static_library',
381       'dependencies': [
382         'command_buffer_client',
383         'gles2_c_lib',
384         '../third_party/npapi/npapi.gyp:npapi',
385       ],
386       'all_dependent_settings': {
387         'include_dirs': [
388           '../third_party/npapi/bindings',
389         ],
390       },
391       'sources': [
392         'pgl/command_buffer_pepper.cc',
393         'pgl/command_buffer_pepper.h',
394         'pgl/pgl_proc_address.cc',
395         'pgl/pgl.cc',
396         'pgl/pgl.h',
397       ],
398     },
399   ],
400   'conditions': [
401     ['OS == "win"',
402       {
403         'targets': [
404           {
405             'target_name': 'gles2_demo',
406             'type': 'executable',
407             'dependencies': [
408               'command_buffer_service',
409               'gles2_demo_lib',
410             ],
411             'sources': [
412               'command_buffer/client/gles2_demo.cc',
413             ],
414             'msvs_settings': {
415               'VCLinkerTool': {
416                 # 0 == not set
417                 # 1 == /SUBSYSTEM:CONSOLE
418                 # 2 == /SUBSYSTEM:WINDOWS
419                'SubSystem': '2',
420               },
421             },
422           },
423         ],
424       },
425     ],
426   ],
429 # Local Variables:
430 # tab-width:2
431 # indent-tabs-mode:nil
432 # End:
433 # vim: set expandtab tabstop=2 shiftwidth=2: