summaryrefslogtreecommitdiffstats
path: root/ppapi/ppapi_gl.gypi
blob: 4f2b16c11933cb59652145fa7c12057605d27bda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Copyright (c) 2010 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.


# This file was split off from ppapi.gyp to prevent PPAPI users from
# needing to DEPS in ~10K files due to mesa.
{
  'includes': [
    '../third_party/mesa/mesa.gypi',
  ],
  'targets': [
    {
      'target_name': 'ppapi_egl',
      'type': 'static_library',
      'dependencies': [
        '<(DEPTH)/ppapi/ppapi.gyp:ppapi_c',
      ],
      'include_dirs': [
        'lib/gl/include',
      ],
      'defines': [
        # Do not export internal Mesa funcations. Exporting them is not
        # required because we are compiling both - API dispatcher and driver
        # into a single library.
        'PUBLIC=',
        # Define a new PPAPI platform.
        '_EGL_PLATFORM_PPAPI=_EGL_NUM_PLATFORMS',
        '_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_PPAPI',
      ],
      'conditions': [
        ['OS=="win"', {
          'defines': [
            '_EGL_OS_WINDOWS',
          ],
        }],
        ['OS=="mac"', {
          # TODO(alokp): Make this compile on mac.
          'suppress_wildcard': 1,
        }],
      ],
      'sources': [
        # Mesa EGL API dispatcher sources.
        '<@(mesa_egl_sources)',
        # PPAPI EGL driver sources.
        'lib/gl/egl/egldriver.c',
        'lib/gl/egl/egldriver_ppapi.c',
      ],
    },
    {
      'target_name': 'ppapi_gles2',
      'type': 'static_library',
      'dependencies': [
        'ppapi_c',
      ],
      'include_dirs': [
        'lib/gl/include',
      ],
      'sources': [
        'lib/gl/gles2/gl2ext_ppapi.c',
        'lib/gl/gles2/gl2ext_ppapi.h',
        'lib/gl/gles2/gles2.c',
      ],
    },
    {
      'target_name': 'ppapi_gles_bindings',
      'type': 'none',
      'suppress_wildcard': 1,
      'actions': [
       {
         'action_name': 'generate_ppapi_gles_bindings',
         'variables': {
           'gles_script': '<(DEPTH)/gpu/command_buffer/build_gles2_cmd_buffer.py',
         },
         'inputs': [
           '<(gles_script)',
         ],
         'outputs': [
           'c/dev/ppb_opengles_dev.h',
           'lib/gl/gles2/gles2.c',
         ],
         'action': [
           'python',
           '<(gles_script)',
           '--alternate-mode=ppapi'
         ],
         'message': 'Generating Pepper OpenGL ES bindings',
       }],
    },
  ],
}