Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / ui / gl / gl.gyp
blobf0f026a1ffe83af0aec7a0966458d06149e29422
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     'chromium_code': 1,
8   },
10   'targets': [
11     {
12       'target_name': 'gl',
13       'type': '<(component)',
14       'product_name': 'gl_wrapper',  # Avoid colliding with OS X's libGL.dylib
15       'dependencies': [
16         '<(DEPTH)/base/base.gyp:base',
17         '<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
18         '<(DEPTH)/gpu/command_buffer/command_buffer.gyp:gles2_utils',
19         '<(DEPTH)/skia/skia.gyp:skia',
20         '<(DEPTH)/third_party/mesa/mesa.gyp:mesa_headers',
21         '<(DEPTH)/ui/gfx/gfx.gyp:gfx',
22         '<(DEPTH)/ui/gfx/gfx.gyp:gfx_geometry',
23       ],
24       'defines': [
25         'GL_IMPLEMENTATION',
26       ],
27       'include_dirs': [
28         '<(DEPTH)/third_party/swiftshader/include',
29         '<(DEPTH)/third_party/khronos',
30       ],
31       'export_dependent_settings': [
32         '<(DEPTH)/third_party/mesa/mesa.gyp:mesa_headers',
33       ],
34       'sources': [
35         'android/gl_jni_registrar.cc',
36         'android/gl_jni_registrar.h',
37         'android/scoped_java_surface.cc',
38         'android/scoped_java_surface.h',
39         'android/surface_texture.cc',
40         'android/surface_texture.h',
41         'android/surface_texture_listener.cc',
42         'android/surface_texture_listener.h',
43         'gl_bindings.cc',
44         'gl_bindings.h',
45         'gl_bindings_autogen_gl.cc',
46         'gl_bindings_autogen_gl.h',
47         'gl_bindings_autogen_osmesa.cc',
48         'gl_bindings_autogen_osmesa.h',
49         'gl_bindings_skia_in_process.cc',
50         'gl_bindings_skia_in_process.h',
51         'gl_context.cc',
52         'gl_context.h',
53         'gl_context_android.cc',
54         'gl_context_mac.mm',
55         'gl_context_osmesa.cc',
56         'gl_context_osmesa.h',
57         'gl_context_ozone.cc',
58         'gl_context_stub.cc',
59         'gl_context_stub.h',
60         'gl_context_stub_with_extensions.cc',
61         'gl_context_stub_with_extensions.h',
62         'gl_context_win.cc',
63         'gl_context_x11.cc',
64         'gl_enums.cc',
65         'gl_enums.h',
66         'gl_enums_implementation_autogen.h',
67         'gl_export.h',
68         'gl_fence.cc',
69         'gl_fence.h',
70         'gl_fence_arb.cc',
71         'gl_fence_arb.h',
72         'gl_fence_nv.cc',
73         'gl_fence_nv.h',
74         'gl_gl_api_implementation.cc',
75         'gl_gl_api_implementation.h',
76         'gl_image.h',
77         'gl_image_memory.cc',
78         'gl_image_memory.h',
79         'gl_image_ref_counted_memory.cc',
80         'gl_image_ref_counted_memory.h',
81         'gl_image_shared_memory.cc',
82         'gl_image_shared_memory.h',
83         'gl_image_stub.cc',
84         'gl_image_stub.h',
85         'gl_implementation.cc',
86         'gl_implementation.h',
87         'gl_implementation_android.cc',
88         'gl_implementation_mac.cc',
89         'gl_implementation_ozone.cc',
90         'gl_implementation_win.cc',
91         'gl_implementation_x11.cc',
92         'gl_osmesa_api_implementation.cc',
93         'gl_osmesa_api_implementation.h',
94         'gl_share_group.cc',
95         'gl_share_group.h',
96         'gl_state_restorer.cc',
97         'gl_state_restorer.h',
98         'gl_surface.cc',
99         'gl_surface.h',
100         'gl_surface_android.cc',
101         'gl_surface_mac.cc',
102         'gl_surface_osmesa.cc',
103         'gl_surface_osmesa.h',
104         'gl_surface_ozone.cc',
105         'gl_surface_stub.cc',
106         'gl_surface_stub.h',
107         'gl_surface_win.cc',
108         'gl_surface_x11.cc',
109         'gl_switches.cc',
110         'gl_switches.h',
111         'gl_version_info.cc',
112         'gl_version_info.h',
113         'gpu_switching_manager.cc',
114         'gpu_switching_manager.h',
115         'gpu_switching_observer.h',
116         'gpu_timing.cc',
117         'gpu_timing.h',
118         'scoped_api.cc',
119         'scoped_api.h',
120         'scoped_binders.cc',
121         'scoped_binders.h',
122         'scoped_make_current.cc',
123         'scoped_make_current.h',
124         'sync_control_vsync_provider.cc',
125         'sync_control_vsync_provider.h',
126         'trace_util.cc',
127         'trace_util.h',
128       ],
129       'conditions': [
130         ['OS in ("win", "android", "linux")', {
131           'sources': [
132             'egl_util.cc',
133             'egl_util.h',
134             'gl_bindings_autogen_egl.cc',
135             'gl_bindings_autogen_egl.h',
136             'gl_context_egl.cc',
137             'gl_context_egl.h',
138             'gl_egl_api_implementation.cc',
139             'gl_egl_api_implementation.h',
140             'gl_fence_egl.cc',
141             'gl_fence_egl.h',
142             'gl_image_egl.cc',
143             'gl_image_egl.h',
144             'gl_surface_egl.cc',
145             'gl_surface_egl.h',
146           ],
147           'include_dirs': [
148             '<(DEPTH)/third_party/khronos',
149         ],
150         }],
151         ['OS in ("android", "linux")', {
152           'sources': [
153             'gl_implementation_osmesa.cc',
154             'gl_implementation_osmesa.h',
155           ],
156         }],
157         ['use_x11 == 1', {
158           'sources': [
159             'gl_bindings_autogen_glx.cc',
160             'gl_bindings_autogen_glx.h',
161             'gl_context_glx.cc',
162             'gl_context_glx.h',
163             'gl_egl_api_implementation.cc',
164             'gl_egl_api_implementation.h',
165             'gl_glx_api_implementation.cc',
166             'gl_glx_api_implementation.h',
167             'gl_image_glx.cc',
168             'gl_image_glx.h',
169             'gl_surface_glx.cc',
170             'gl_surface_glx.h',
171           ],
172           'all_dependent_settings': {
173             'defines': [
174               'GL_GLEXT_PROTOTYPES',
175             ],
176           },
177           'dependencies': [
178             '<(DEPTH)/build/linux/system.gyp:x11',
179             '<(DEPTH)/build/linux/system.gyp:xcomposite',
180             '<(DEPTH)/build/linux/system.gyp:xext',
181             '<(DEPTH)/ui/events/platform/events_platform.gyp:events_platform',
182             '<(DEPTH)/ui/gfx/x/gfx_x11.gyp:gfx_x11',
183           ],
184         }],
185         ['OS=="win"', {
186           'sources': [
187             'angle_platform_impl.cc',
188             'angle_platform_impl.h',
189             'gl_bindings_autogen_wgl.cc',
190             'gl_bindings_autogen_wgl.h',
191             'gl_context_wgl.cc',
192             'gl_context_wgl.h',
193             'gl_egl_api_implementation.cc',
194             'gl_egl_api_implementation.h',
195             'gl_surface_wgl.cc',
196             'gl_surface_wgl.h',
197             'gl_wgl_api_implementation.cc',
198             'gl_wgl_api_implementation.h',
199           ],
200           'msvs_settings': {
201             'VCLinkerTool': {
202               'DelayLoadDLLs': [
203                 'dwmapi.dll',
204               ],
205               'AdditionalDependencies': [
206                 'dwmapi.lib',
207               ],
208             },
209           },
210           'link_settings': {
211             'libraries': [
212               '-ldwmapi.lib',
213             ],
214           },
215           'dependencies': [
216             '<(DEPTH)/third_party/angle/src/angle.gyp:libEGL',
217             '<(DEPTH)/third_party/angle/src/angle.gyp:libGLESv2',
218           ],
219         }],
220         ['OS=="mac"', {
221           'sources': [
222             'gl_context_cgl.cc',
223             'gl_context_cgl.h',
224             'gl_fence_apple.cc',
225             'gl_fence_apple.h',
226             'gl_image_io_surface.mm',
227             'gl_image_io_surface.h',
228             'scoped_cgl.cc',
229             'scoped_cgl.h',
230           ],
231           'link_settings': {
232             'libraries': [
233               '$(SDKROOT)/System/Library/Frameworks/IOSurface.framework',
234               '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
235               '$(SDKROOT)/System/Library/Frameworks/Quartz.framework',
236             ],
237           },
238         }],
239         ['OS=="android"', {
240           'dependencies': [
241             'gl_jni_headers',
242             '../android/ui_android.gyp:ui_java',
243           ],
244           'sources': [
245             'gl_image_surface_texture.cc',
246             'gl_image_surface_texture.h',
247           ],
248           'link_settings': {
249             'libraries': [
250               '-landroid',
251             ],
252           },
253           'sources!': [
254             'system_monitor_posix.cc',
255           ],
256           'defines': [
257             'GL_GLEXT_PROTOTYPES',
258             'EGL_EGLEXT_PROTOTYPES',
259           ],
260         }],
261         ['OS!="android"', {
262           'sources/': [ ['exclude', '^android/'] ],
263         }],
264         ['use_ozone==1', {
265           'sources': [
266             'gl_image_ozone_native_pixmap.cc',
267             'gl_image_ozone_native_pixmap.h',
268           ],
269           'dependencies': [
270             '../ozone/ozone.gyp:ozone',
271             '../ozone/ozone.gyp:ozone_base',
272           ],
273         }],
274       ],
275     },
276     {
277       'target_name': 'gl_unittest_utils',
278       'type': 'static_library',
279       'dependencies': [
280         '../../testing/gmock.gyp:gmock',
281         '../../third_party/khronos/khronos.gyp:khronos_headers',
282         'gl',
283       ],
284       'include_dirs': [
285         '../..',
286       ],
287       'sources': [
288         'gl_bindings_autogen_mock.cc',
289         'gl_bindings_autogen_mock.h',
290         'gl_mock.cc',
291         'gl_mock.h',
292         'gl_mock_autogen_gl.h',
293         'gpu_timing_fake.cc',
294         'gpu_timing_fake.h',
295       ],
296     },
297     {
298       'target_name': 'gl_test_support',
299       'type': 'static_library',
300       'dependencies': [
301         '../../third_party/khronos/khronos.gyp:khronos_headers',
302         'gl',
303       ],
304       'include_dirs': [
305         '../..',
306       ],
307       'sources': [
308         'test/gl_surface_test_support.cc',
309         'test/gl_surface_test_support.h',
310       ],
311       'conditions': [
312         ['use_x11==1', {
313           'dependencies': [
314             '../../build/linux/system.gyp:x11',
315             '../gfx/x/gfx_x11.gyp:gfx_x11',
316             '../platform_window/x11/x11_window.gyp:x11_window',
317           ],
318         }],
319       ],
320     },
321   ],
322   'conditions': [
323     ['OS=="android"' , {
324       'targets': [
325         {
326           'target_name': 'surface_jni_headers',
327           'type': 'none',
328           'variables': {
329             'jni_gen_package': 'ui/gl',
330             'input_java_class': 'android/view/Surface.class',
331           },
332           'includes': [ '../../build/jar_file_jni_generator.gypi' ],
333         },
334         {
335           'target_name': 'gl_jni_headers',
336           'type': 'none',
337           'dependencies': [
338             'surface_jni_headers',
339           ],
340           'sources': [
341             '../android/java/src/org/chromium/ui/gl/SurfaceTexturePlatformWrapper.java',
342             '../android/java/src/org/chromium/ui/gl/SurfaceTextureListener.java',
343           ],
344           'variables': {
345             'jni_gen_package': 'ui/gl',
346           },
347           'includes': [ '../../build/jni_generator.gypi' ],
348         },
349       ],
350     }],
351   ],