summaryrefslogtreecommitdiffstats
path: root/o3d/gpu_plugin/gpu_plugin.gyp
blob: c8dd6be4dee54b8b17d4248ef7bc68b88f4ce701 (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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
# Copyright (c) 2009 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.

{
  'includes': [
    '../build/common.gypi',
  ],
  'targets': [
    {
      'target_name': 'np_utils',
      'type': '<(library)',
      'dependencies': [
        '../../base/base.gyp:base',
      ],
      'include_dirs': [
        '../..',
        '../../third_party/npapi',

        # Chrome NPAPI header dir appears before the O3D one so it takes
        # priority. TODO(apatrick): one set of NPAPI headers.
        '../../third_party/npapi/bindings',
        '../../third_party/npapi/include',
      ],
      'direct_dependent_settings': {
        'include_dirs': [
          '../../third_party/npapi',

          # Chrome NPAPI header dir appears before the O3D one so it takes
          # priority. TODO(apatrick): one set of NPAPI headers.
          '../../third_party/npapi/bindings',
          '../../third_party/npapi/include',
        ],
      },  # 'direct_dependent_settings'
      'sources': [
        'np_utils/default_np_object.h',
        'np_utils/dynamic_np_object.cc',
        'np_utils/dynamic_np_object.h',
        'np_utils/np_browser.cc',
        'np_utils/np_browser.h',
        'np_utils/np_browser_mock.h',
        'np_utils/np_browser_stub.cc',
        'np_utils/np_browser_stub.h',
        'np_utils/np_class.h',
        'np_utils/np_dispatcher.cc',
        'np_utils/np_dispatcher.h',
        'np_utils/np_dispatcher_specializations.h',
        'np_utils/np_headers.h',
        'np_utils/np_object_mock.h',
        'np_utils/np_object_pointer.h',
        'np_utils/np_plugin_object.h',
        'np_utils/np_plugin_object_factory.cc',
        'np_utils/np_plugin_object_factory.h',
        'np_utils/np_plugin_object_factory_mock.h',
        'np_utils/np_plugin_object_mock.h',
        'np_utils/np_utils.cc',
        'np_utils/np_utils.h',
        'np_utils/webkit_browser.h',
      ],
    },

    # This is a standalone executable until O3D is fully moved over to using
    # gyp. At that point these can become part of the regular O3D unit tests.
    {
      'target_name': 'np_utils_unittests',
      'type': 'executable',
      'dependencies': [
        'np_utils',
        '../../testing/gmock.gyp:gmock',
        '../../testing/gmock.gyp:gmockmain',
        '../../testing/gtest.gyp:gtest',
      ],
      'include_dirs': [
        '../..',
        '../../third_party/npapi',
      ],
      'sources': [
        'np_utils/dispatched_np_object_unittest.cc',
        'np_utils/dynamic_np_object_unittest.cc',
        'np_utils/np_class_unittest.cc',
        'np_utils/np_object_pointer_unittest.cc',
        'np_utils/np_utils_unittest.cc',
      ],
    },

    {
      'target_name': 'system_services',
      'type': '<(library)',
      'dependencies': [
        '../../base/base.gyp:base',
        'np_utils',
      ],
      'include_dirs': [
        '../..',
        '../../third_party/npapi',

        # Chrome NPAPI header dir appears before the O3D one so it takes
        # priority. TODO(apatrick): one set of NPAPI headers.
        '../../third_party/npapi/bindings',
        '../../third_party/npapi/include',
      ],
      'direct_dependent_settings': {
        'include_dirs': [
          '../../third_party/npapi',

          # Chrome NPAPI header dir appears before the O3D one so it takes
          # priority. TODO(apatrick): one set of NPAPI headers.
          '../../third_party/npapi/bindings',
          '../../third_party/npapi/include',
        ],
      },
      'sources': [
        'system_services/shared_memory.cc',
        'system_services/shared_memory.h',
        'system_services/shared_memory_mock.h',
        'system_services/shared_memory_public.h',
      ],
    },

    # This is a standalone executable until O3D is fully moved over to using
    # gyp. At that point these can become part of the regular O3D unit tests.
    {
      'target_name': 'system_services_unittests',
      'type': 'executable',
      'dependencies': [
        'system_services',
        '../../testing/gmock.gyp:gmock',
        '../../testing/gmock.gyp:gmockmain',
        '../../testing/gtest.gyp:gtest',
      ],
      'include_dirs': [
        '../..',
        '../../third_party/npapi',
      ],
      'sources': [
        'system_services/shared_memory_unittest.cc',
      ],
    },

    # This builds a subset of the O3D command buffer common library. This is a
    # separate library for the time being because I need a subset that is not
    # dependent on NaCl.
    {
      'target_name': 'command_buffer_common_subset',
      'type': '<(library)',
      'include_dirs': [
        '..',
        '../..',
      ],
      'direct_dependent_settings': {
        'include_dirs': [
          '..',
        ],
      },  # 'direct_dependent_settings'
      'sources': [
        '../command_buffer/common/cross/bitfield_helpers.h',
        '../command_buffer/common/cross/cmd_buffer_format.h',
        '../command_buffer/common/cross/gapi_interface.h',
        '../command_buffer/common/cross/logging.h',
        '../command_buffer/common/cross/mocks.h',
        '../command_buffer/common/cross/resource.cc',
        '../command_buffer/common/cross/resource.h',
        '../command_buffer/common/cross/types.h',
      ],
    },

    # This builds a subset of the O3D command buffer service. This is a separate
    # library for the time being because I need a subset that is not dependent
    # on NaCl.
    {
      'target_name': 'command_buffer_service_subset',
      'type': '<(library)',
      'include_dirs': [
        '..',
        '../..',
      ],
      'direct_dependent_settings': {
        'include_dirs': [
          '..',
        ],
      },  # 'direct_dependent_settings'
      'dependencies': [
        'command_buffer_common_subset',
      ],
      'sources': [
        '../command_buffer/service/cross/cmd_parser.cc',
        '../command_buffer/service/cross/cmd_parser.h',
        '../command_buffer/service/cross/effect_utils.cc',
        '../command_buffer/service/cross/effect_utils.h',
        '../command_buffer/service/cross/gapi_decoder.cc',
        '../command_buffer/service/cross/gapi_decoder.h',
        '../command_buffer/service/cross/mocks.h',
        '../command_buffer/service/cross/precompile.cc',
        '../command_buffer/service/cross/precompile.h',
        '../command_buffer/service/cross/resource.cc',
        '../command_buffer/service/cross/resource.h',
        '../command_buffer/service/cross/texture_utils.cc',
        '../command_buffer/service/cross/texture_utils.h',
      ],

      'conditions': [
        ['OS == "win"',
          {
            'sources': [
              '../command_buffer/service/win/d3d9/d3d9_utils.h',
              '../command_buffer/service/win/d3d9/effect_d3d9.cc',
              '../command_buffer/service/win/d3d9/effect_d3d9.h',
              '../command_buffer/service/win/d3d9/gapi_d3d9.cc',
              '../command_buffer/service/win/d3d9/gapi_d3d9.h',
              '../command_buffer/service/win/d3d9/geometry_d3d9.cc',
              '../command_buffer/service/win/d3d9/geometry_d3d9.h',
              '../command_buffer/service/win/d3d9/render_surface_d3d9.cc',
              '../command_buffer/service/win/d3d9/render_surface_d3d9.h',
              '../command_buffer/service/win/d3d9/sampler_d3d9.cc',
              '../command_buffer/service/win/d3d9/sampler_d3d9.h',
              '../command_buffer/service/win/d3d9/states_d3d9.cc',
              '../command_buffer/service/win/d3d9/texture_d3d9.cc',
              '../command_buffer/service/win/d3d9/texture_d3d9.h',
            ],  # 'sources'
            'include_dirs': [
              '$(DXSDK_DIR)/Include',
            ],
            'direct_dependent_settings': {
              'include_dirs': [
                '$(DXSDK_DIR)/Include',
              ],
            },  # 'direct_dependent_settings'
          },
        ],
        ['OS == "mac" or OS == "linux"',
          {
            'sources': [
              '../command_buffer/service/cross/gl/effect_gl.cc',
              '../command_buffer/service/cross/gl/effect_gl.h',
              '../command_buffer/service/cross/gl/gapi_gl.cc',
              '../command_buffer/service/cross/gl/gapi_gl.h',
              '../command_buffer/service/cross/gl/geometry_gl.cc',
              '../command_buffer/service/cross/gl/geometry_gl.h',
              '../command_buffer/service/cross/gl/gl_utils.h',
              '../command_buffer/service/cross/gl/sampler_gl.cc',
              '../command_buffer/service/cross/gl/sampler_gl.h',
              '../command_buffer/service/cross/gl/states_gl.cc',
              '../command_buffer/service/cross/gl/texture_gl.cc',
              '../command_buffer/service/cross/gl/texture_gl.h',
            ],  # 'sources'
          },
        ],
        ['OS == "linux"',
          {
            'sources': [
              '../command_buffer/service/linux/x_utils.cc',
              '../command_buffer/service/linux/x_utils.h',
            ],
          },
        ],
      ],
    },

    {
      'target_name': 'gpu_plugin',
      'type': '<(library)',
      'dependencies': [
        '../../base/base.gyp:base',
        'command_buffer_service_subset',
        'np_utils',
      ],
      'include_dirs': [
        '../..',
        '../../third_party/npapi',
      ],
      'sources': [
        'command_buffer.cc',
        'command_buffer.h',
        'command_buffer_mock.h',
        'gpu_plugin.cc',
        'gpu_plugin.h',
        'gpu_plugin_object.cc',
        'gpu_plugin_object.h',
        'gpu_plugin_object_win.cc',
        'gpu_plugin_object_factory.cc',
        'gpu_plugin_object_factory.h',
        'gpu_processor.h',
        'gpu_processor.cc',
        'gpu_processor_win.cc',
      ],
    },

    # This is a standalone executable until O3D is fully moved over to using
    # gyp. At that point these can become part of the regular O3D unit tests.
    {
      'target_name': 'gpu_plugin_unittests',
      'type': 'executable',
      'dependencies': [
        'command_buffer_service_subset',
        'gpu_plugin',
        'np_utils',
        'system_services',
        '../../testing/gmock.gyp:gmock',
        '../../testing/gmock.gyp:gmockmain',
        '../../testing/gtest.gyp:gtest',
      ],
      'include_dirs': [
        '../..',
        '../../third_party/npapi',
      ],
      'conditions': [
        ['OS == "win" and (renderer == "d3d9" or renderer == "cb")',
          {
            # These dependencies are temporary until the command buffer code
            # loads D3D and D3DX dynamically.
            'link_settings': {
              'libraries': [
                '"$(DXSDK_DIR)/Lib/x86/DxErr.lib"',
                '"$(DXSDK_DIR)/Lib/x86/d3dx9.lib"',
                '-ld3d9.lib',
              ],
            },
          },
        ],
      ],
      'sources': [
        'command_buffer_unittest.cc',
        'gpu_plugin_unittest.cc',
        'gpu_plugin_object_unittest.cc',
        'gpu_plugin_object_factory_unittest.cc',
        'gpu_processor_unittest.cc',
      ],
    },
  ]
}

# Local Variables:
# tab-width:2
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=2 shiftwidth=2: