| Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 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 | 'chromium_code': 1, |
| 8 | }, |
| 9 | |
| 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', |
| Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 20 | '<(DEPTH)/third_party/mesa/mesa.gyp:mesa_headers', |
| Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 21 | '<(DEPTH)/ui/ui.gyp:ui', |
| 22 | ], |
| 23 | 'variables': { |
| 24 | 'gl_binding_output_dir': '<(SHARED_INTERMEDIATE_DIR)/ui/gl', |
| 25 | }, |
| 26 | 'defines': [ |
| 27 | 'GL_IMPLEMENTATION', |
| 28 | ], |
| 29 | 'include_dirs': [ |
| 30 | '<(DEPTH)/third_party/swiftshader/include', |
| Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 31 | '<(DEPTH)/third_party/mesa/src/include', |
| Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 32 | '<(gl_binding_output_dir)', |
| 33 | ], |
| 34 | 'direct_dependent_settings': { |
| 35 | 'include_dirs': [ |
| Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 36 | '<(gl_binding_output_dir)', |
| 37 | ], |
| 38 | }, |
| Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 39 | 'export_dependent_settings': [ |
| 40 | '<(DEPTH)/third_party/mesa/mesa.gyp:mesa_headers', |
| 41 | ], |
| Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 42 | 'sources': [ |
| Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 43 | 'android/gl_jni_registrar.cc', |
| 44 | 'android/gl_jni_registrar.h', |
| 45 | 'android/scoped_java_surface.cc', |
| 46 | 'android/scoped_java_surface.h', |
| 47 | 'android/surface_texture_bridge.cc', |
| 48 | 'android/surface_texture_bridge.h', |
| 49 | 'android/surface_texture_listener.cc', |
| 50 | 'android/surface_texture_listener.h', |
| Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 51 | 'gl_bindings.h', |
| 52 | 'gl_bindings_skia_in_process.cc', |
| 53 | 'gl_bindings_skia_in_process.h', |
| 54 | 'gl_context.cc', |
| 55 | 'gl_context.h', |
| 56 | 'gl_context_android.cc', |
| Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 57 | 'gl_context_mac.mm', |
| Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 58 | 'gl_context_ozone.cc', |
| Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 59 | 'gl_context_osmesa.cc', |
| 60 | 'gl_context_osmesa.h', |
| 61 | 'gl_context_stub.cc', |
| 62 | 'gl_context_stub.h', |
| 63 | 'gl_context_win.cc', |
| Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 64 | 'gl_context_x11.cc', |
| Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 65 | 'gl_export.h', |
| 66 | 'gl_fence.cc', |
| 67 | 'gl_fence.h', |
| 68 | 'gl_gl_api_implementation.cc', |
| 69 | 'gl_gl_api_implementation.h', |
| 70 | 'gl_image.cc', |
| 71 | 'gl_image.h', |
| 72 | 'gl_image_android.cc', |
| Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 73 | 'gl_image_mac.cc', |
| Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 74 | 'gl_image_ozone.cc', |
| Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 75 | 'gl_image_stub.cc', |
| 76 | 'gl_image_stub.h', |
| 77 | 'gl_image_win.cc', |
| Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 78 | 'gl_image_x11.cc', |
| Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 79 | 'gl_implementation.cc', |
| 80 | 'gl_implementation.h', |
| 81 | 'gl_implementation_android.cc', |
| Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 82 | 'gl_implementation_ozone.cc', |
| Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 83 | 'gl_implementation_mac.cc', |
| 84 | 'gl_implementation_win.cc', |
| Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 85 | 'gl_implementation_x11.cc', |
| Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 86 | 'gl_interface.cc', |
| 87 | 'gl_interface.h', |
| 88 | 'gl_osmesa_api_implementation.cc', |
| 89 | 'gl_osmesa_api_implementation.h', |
| 90 | 'gl_share_group.cc', |
| 91 | 'gl_share_group.h', |
| 92 | 'gl_state_restorer.cc', |
| 93 | 'gl_state_restorer.h', |
| 94 | 'gl_surface.cc', |
| 95 | 'gl_surface.h', |
| Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 96 | 'gl_surface_mac.cc', |
| 97 | 'gl_surface_stub.cc', |
| 98 | 'gl_surface_stub.h', |
| 99 | 'gl_surface_win.cc', |
| Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 100 | 'gl_surface_x11.cc', |
| Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 101 | 'gl_surface_osmesa.cc', |
| 102 | 'gl_surface_osmesa.h', |
| 103 | 'gl_switches.cc', |
| 104 | 'gl_switches.h', |
| 105 | 'gpu_switching_manager.cc', |
| 106 | 'gpu_switching_manager.h', |
| Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame^] | 107 | 'io_surface_support_mac.cc', |
| 108 | 'io_surface_support_mac.h', |
| Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 109 | 'scoped_binders.cc', |
| 110 | 'scoped_binders.h', |
| Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 111 | 'scoped_make_current.cc', |
| 112 | 'scoped_make_current.h', |
| Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 113 | 'vsync_provider.cc', |
| 114 | 'vsync_provider.h', |
| Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 115 | '<(gl_binding_output_dir)/gl_bindings_autogen_gl.cc', |
| 116 | '<(gl_binding_output_dir)/gl_bindings_autogen_gl.h', |
| 117 | '<(gl_binding_output_dir)/gl_bindings_autogen_mock.cc', |
| 118 | '<(gl_binding_output_dir)/gl_bindings_autogen_osmesa.cc', |
| 119 | '<(gl_binding_output_dir)/gl_bindings_autogen_osmesa.h', |
| Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 120 | '<(gl_binding_output_dir)/gl_interface_autogen_gl.h', |
| Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 121 | ], |
| 122 | # hard_dependency is necessary for this target because it has actions |
| 123 | # that generate header files included by dependent targets. The header |
| 124 | # files must be generated before the dependents are compiled. The usual |
| 125 | # semantics are to allow the two targets to build concurrently. |
| 126 | 'hard_dependency': 1, |
| 127 | 'actions': [ |
| 128 | { |
| 129 | 'action_name': 'generate_gl_bindings', |
| Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 130 | 'variables': { |
| 131 | 'generator_path': 'generate_bindings.py', |
| 132 | 'conditions': [ |
| 133 | ['use_system_mesa==0', { |
| Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 134 | 'header_paths': '../../third_party/mesa/src/include:../../third_party/khronos', |
| Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 135 | }, { # use_system_mesa==1 |
| 136 | 'header_paths': '/usr/include', |
| 137 | }], |
| 138 | ], |
| 139 | }, |
| Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 140 | 'inputs': [ |
| Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 141 | '<(generator_path)', |
| 142 | '<!@(python <(generator_path) --header-paths=<(header_paths) --inputs)', |
| Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 143 | ], |
| 144 | 'outputs': [ |
| 145 | '<(gl_binding_output_dir)/gl_bindings_autogen_egl.cc', |
| 146 | '<(gl_binding_output_dir)/gl_bindings_autogen_egl.h', |
| 147 | '<(gl_binding_output_dir)/gl_bindings_api_autogen_egl.h', |
| 148 | '<(gl_binding_output_dir)/gl_bindings_autogen_gl.cc', |
| 149 | '<(gl_binding_output_dir)/gl_bindings_autogen_gl.h', |
| 150 | '<(gl_binding_output_dir)/gl_bindings_api_autogen_gl.h', |
| 151 | '<(gl_binding_output_dir)/gl_bindings_autogen_glx.cc', |
| 152 | '<(gl_binding_output_dir)/gl_bindings_autogen_glx.h', |
| 153 | '<(gl_binding_output_dir)/gl_bindings_api_autogen_glx.h', |
| 154 | '<(gl_binding_output_dir)/gl_bindings_autogen_mock.cc', |
| 155 | '<(gl_binding_output_dir)/gl_bindings_autogen_osmesa.cc', |
| 156 | '<(gl_binding_output_dir)/gl_bindings_autogen_osmesa.h', |
| 157 | '<(gl_binding_output_dir)/gl_bindings_api_autogen_osmesa.h', |
| 158 | '<(gl_binding_output_dir)/gl_bindings_autogen_wgl.cc', |
| 159 | '<(gl_binding_output_dir)/gl_bindings_autogen_wgl.h', |
| 160 | '<(gl_binding_output_dir)/gl_bindings_api_autogen_wgl.h', |
| Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 161 | '<(gl_binding_output_dir)/gl_interface_autogen_egl.h', |
| 162 | '<(gl_binding_output_dir)/gl_interface_autogen_gl.h', |
| 163 | '<(gl_binding_output_dir)/gl_interface_autogen_glx.h', |
| 164 | '<(gl_binding_output_dir)/gl_interface_autogen_osmesa.h', |
| 165 | '<(gl_binding_output_dir)/gl_interface_autogen_wgl.h', |
| 166 | '<(gl_binding_output_dir)/gl_mock_autogen_egl.h', |
| 167 | '<(gl_binding_output_dir)/gl_mock_autogen_gl.h', |
| 168 | '<(gl_binding_output_dir)/gl_mock_autogen_glx.h', |
| 169 | '<(gl_binding_output_dir)/gl_mock_autogen_osmesa.h', |
| 170 | '<(gl_binding_output_dir)/gl_mock_autogen_wgl.h', |
| Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 171 | ], |
| 172 | 'action': [ |
| 173 | 'python', |
| Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 174 | '<(generator_path)', |
| 175 | '--header-paths=<(header_paths)', |
| Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 176 | '<(gl_binding_output_dir)', |
| 177 | ], |
| 178 | }, |
| 179 | ], |
| 180 | 'conditions': [ |
| Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 181 | ['OS in ("win", "android", "linux")', { |
| Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 182 | 'sources': [ |
| 183 | 'egl_util.cc', |
| 184 | 'egl_util.h', |
| 185 | 'gl_context_egl.cc', |
| 186 | 'gl_context_egl.h', |
| 187 | 'gl_surface_egl.cc', |
| 188 | 'gl_surface_egl.h', |
| 189 | 'gl_egl_api_implementation.cc', |
| 190 | 'gl_egl_api_implementation.h', |
| 191 | '<(gl_binding_output_dir)/gl_bindings_autogen_egl.cc', |
| 192 | '<(gl_binding_output_dir)/gl_bindings_autogen_egl.h', |
| 193 | ], |
| 194 | 'include_dirs': [ |
| Torne (Richard Coles) | a93a17c | 2013-05-15 11:34:50 +0100 | [diff] [blame] | 195 | '<(DEPTH)/third_party/khronos', |
| 196 | ], |
| Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 197 | }], |
| 198 | ['use_x11 == 1', { |
| 199 | 'sources': [ |
| 200 | 'gl_context_glx.cc', |
| 201 | 'gl_context_glx.h', |
| 202 | 'gl_glx_api_implementation.cc', |
| 203 | 'gl_glx_api_implementation.h', |
| 204 | 'gl_image_glx.cc', |
| 205 | 'gl_image_glx.h', |
| 206 | 'gl_surface_glx.cc', |
| 207 | 'gl_surface_glx.h', |
| 208 | 'gl_egl_api_implementation.cc', |
| 209 | 'gl_egl_api_implementation.h', |
| 210 | '<(gl_binding_output_dir)/gl_bindings_autogen_glx.cc', |
| 211 | '<(gl_binding_output_dir)/gl_bindings_autogen_glx.h', |
| 212 | ], |
| 213 | 'all_dependent_settings': { |
| 214 | 'defines': [ |
| 215 | 'GL_GLEXT_PROTOTYPES', |
| 216 | ], |
| 217 | }, |
| 218 | 'link_settings': { |
| 219 | 'libraries': [ |
| 220 | '-lX11', |
| 221 | '-lXcomposite', |
| 222 | ], |
| 223 | }, |
| 224 | }], |
| 225 | ['OS=="win"', { |
| 226 | 'sources': [ |
| 227 | 'gl_context_wgl.cc', |
| 228 | 'gl_context_wgl.h', |
| 229 | 'gl_egl_api_implementation.cc', |
| 230 | 'gl_egl_api_implementation.h', |
| 231 | 'gl_surface_wgl.cc', |
| 232 | 'gl_surface_wgl.h', |
| 233 | 'gl_wgl_api_implementation.cc', |
| 234 | 'gl_wgl_api_implementation.h', |
| 235 | '<(gl_binding_output_dir)/gl_bindings_autogen_wgl.cc', |
| 236 | '<(gl_binding_output_dir)/gl_bindings_autogen_wgl.h', |
| 237 | ], |
| 238 | }], |
| 239 | ['OS=="mac"', { |
| 240 | 'sources': [ |
| 241 | 'gl_context_cgl.cc', |
| 242 | 'gl_context_cgl.h', |
| 243 | 'gl_surface_cgl.cc', |
| 244 | 'gl_surface_cgl.h', |
| 245 | ], |
| 246 | 'link_settings': { |
| 247 | 'libraries': [ |
| 248 | '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework', |
| 249 | ], |
| 250 | }, |
| 251 | }], |
| 252 | ['OS=="mac" and use_aura == 1', { |
| 253 | 'sources': [ |
| 254 | 'gl_context_nsview.mm', |
| 255 | 'gl_context_nsview.h', |
| 256 | 'gl_surface_nsview.mm', |
| 257 | 'gl_surface_nsview.h', |
| 258 | ], |
| 259 | }], |
| 260 | ['OS=="android"', { |
| Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 261 | 'dependencies': [ |
| 262 | 'gl_jni_headers', |
| Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 263 | ], |
| Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 264 | 'sources': [ |
| 265 | 'gl_image_egl.cc', |
| 266 | 'gl_image_egl.h', |
| 267 | ], |
| 268 | 'link_settings': { |
| 269 | 'libraries': [ |
| 270 | '-landroid', |
| 271 | ], |
| 272 | }, |
| Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 273 | 'sources!': [ |
| 274 | 'gl_context_osmesa.cc', |
| 275 | 'system_monitor_posix.cc', |
| 276 | ], |
| 277 | 'defines': [ |
| 278 | 'GL_GLEXT_PROTOTYPES', |
| 279 | 'EGL_EGLEXT_PROTOTYPES', |
| 280 | ], |
| 281 | }], |
| Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 282 | ['OS!="android"', { |
| 283 | 'sources/': [ ['exclude', '^android/'] ], |
| 284 | }], |
| Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 285 | ], |
| 286 | }, |
| Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 287 | { |
| 288 | 'target_name': 'gl_unittest_utils', |
| 289 | 'type': 'static_library', |
| 290 | 'variables': { |
| 291 | 'gl_binding_output_dir': '<(SHARED_INTERMEDIATE_DIR)/ui/gl', |
| 292 | }, |
| 293 | 'dependencies': [ |
| 294 | '../../testing/gmock.gyp:gmock', |
| 295 | '../../third_party/khronos/khronos.gyp:khronos_headers', |
| 296 | 'gl', |
| 297 | ], |
| 298 | 'include_dirs': [ |
| 299 | '<(gl_binding_output_dir)', |
| 300 | '../..', |
| 301 | ], |
| 302 | 'direct_dependent_settings': { |
| 303 | 'include_dirs': [ |
| 304 | '<(gl_binding_output_dir)', |
| 305 | ], |
| 306 | }, |
| 307 | 'sources': [ |
| Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 308 | 'gl_image_mock.cc', |
| 309 | 'gl_image_mock.h', |
| Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 310 | 'gl_mock.h', |
| 311 | 'gl_mock.cc', |
| 312 | '<(gl_binding_output_dir)/gl_mock_autogen_gl.h', |
| 313 | ], |
| 314 | }, |
| Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 315 | ], |
| Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 316 | 'conditions': [ |
| 317 | ['OS=="android"' , { |
| 318 | 'targets': [ |
| 319 | { |
| 320 | 'target_name': 'surface_texture_jni_headers', |
| 321 | 'type': 'none', |
| 322 | 'variables': { |
| 323 | 'jni_gen_package': 'ui/gl', |
| 324 | 'input_java_class': 'android/graphics/SurfaceTexture.class', |
| 325 | }, |
| 326 | 'includes': [ '../../build/jar_file_jni_generator.gypi' ], |
| 327 | }, |
| 328 | { |
| 329 | 'target_name': 'surface_jni_headers', |
| 330 | 'type': 'none', |
| 331 | 'variables': { |
| 332 | 'jni_gen_package': 'ui/gl', |
| 333 | 'input_java_class': 'android/view/Surface.class', |
| 334 | }, |
| 335 | 'includes': [ '../../build/jar_file_jni_generator.gypi' ], |
| 336 | }, |
| 337 | { |
| 338 | 'target_name': 'gl_jni_headers', |
| 339 | 'type': 'none', |
| 340 | 'dependencies': [ |
| 341 | 'surface_texture_jni_headers', |
| 342 | 'surface_jni_headers', |
| 343 | ], |
| 344 | 'sources': [ |
| 345 | '../android/java/src/org/chromium/ui/gfx/SurfaceTextureListener.java', |
| 346 | ], |
| 347 | 'variables': { |
| 348 | 'jni_gen_package': 'ui/gl', |
| 349 | }, |
| 350 | 'includes': [ '../../build/jni_generator.gypi' ], |
| 351 | }, |
| 352 | ], |
| 353 | }], |
| 354 | ], |
| Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 355 | } |