Make use of CreateWebUIForRenderManager (doesn't change the actual behavior)
[chromium-blink-merge.git] / gpu / demos / demos.gyp
blobe716bf7e7cf89a5878eb4934a53bcdfb62e09991
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   'includes': [
7     '../../ppapi/ppapi.gypi',
8   ],
9   'variables': {
10     'chromium_code': 1,
11     'conditions': [
12       # Pepper demos that are compiled as shared libraries need to be compiled
13       # with -fPIC flag. All static libraries that these demos depend on must
14       # also be compiled with -fPIC flag. Setting GYP_DEFINES="linux_fpic=1"
15       # compiles everything with -fPIC. Disable pepper demos on linux/x64
16       # unless linux_fpic is 1.
17       ['os_posix == 1 and OS != "mac" and (target_arch=="x64" or target_arch=="arm") and linux_fpic!=1', {
18         'enable_pepper_demos%': 0,
19       }, {
20         'enable_pepper_demos%': 1,
21       }],
22     ],
23   },
24   'targets': [
25     {
26       'target_name': 'gpu_demo_framework',
27       'type': 'static_library',
28       'include_dirs': [
29         '../..',
30       ],
31       'sources': [
32         'framework/demo.cc',
33         'framework/demo.h',
34         'framework/demo_factory.h',
35       ],
36     },
37     {
38       'target_name': 'gpu_demo_framework_exe',
39       'type': 'static_library',
40       'dependencies': [
41         'gpu_demo_framework',
42         '../gpu.gyp:command_buffer_client',
43         '../gpu.gyp:command_buffer_service',
44         '../gpu.gyp:gles2_implementation',
45         '../../base/base.gyp:base',
46         '../../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
47         '../../ui/gl/gl.gyp:gl',
48         '../../ui/ui.gyp:ui',
49       ],
50       'sources': [
51         'framework/main_exe.cc',
52         'framework/window.cc',
53         'framework/window_linux.cc',
54         'framework/window_mac.mm',
55         'framework/window_win.cc',
56         'framework/window.h',
57       ],
58       'conditions': [
59         ['toolkit_uses_gtk == 1', {
60           'dependencies': ['../../build/linux/system.gyp:gtk'],
61         }],
62       ],
63     },
64     {
65       'target_name': 'gpu_demo_framework_ppapi',
66       'suppress_wildcard': 1,  # So that 'all' doesn't end up being a bundle.
67       'type': 'static_library',
68       'dependencies': [
69         'gpu_demo_framework',
70         '../../ppapi/ppapi.gyp:ppapi_cpp_objects',
71         '../../ppapi/ppapi.gyp:ppapi_gles2',
72       ],
73       'include_dirs': [
74         '../..',
75         '../../ppapi/lib/gl/include',
76         '../../third_party/gles2_book/Common/Include',
77       ],
78       'sources': [
79         'framework/pepper.cc',
80         '../../third_party/gles2_book/Common/Include/esUtil.h',
81         '../../third_party/gles2_book/Common/Source/esShader.c',
82         '../../third_party/gles2_book/Common/Source/esShapes.c',
83         '../../third_party/gles2_book/Common/Source/esTransform.c',
84         '../../third_party/gles2_book/Common/Source/esUtil.c',
85       ],
86       'direct_dependent_settings': {
87         'include_dirs': [
88           '../..',
89           '../../ppapi/lib/gl/include',
90           '../../third_party/gles2_book/Common/Include',
91         ],
92         'run_as': {
93           'conditions': [
94             ['OS=="mac"', {
95               'action': [
96                 '<(PRODUCT_DIR)/Chromium.app/Contents/MacOS/Chromium',
97                 '--register-pepper-plugins='
98                   '<(PRODUCT_DIR)/$(PRODUCT_NAME).plugin;'
99                   'pepper-application/x-gpu-demo',
100                 'file://$(SOURCE_ROOT)/pepper_gpu_demo.html',
101               ],
102              }, { # OS != "mac"
103               'action': [
104                 '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)chrome<(EXECUTABLE_SUFFIX)',
105                 '--register-pepper-plugins=$(TargetPath);'
106                   'pepper-application/x-gpu-demo',
107                 'file://$(ProjectDir)pepper_gpu_demo.html',
108               ],
109             }],
110           ],
111         },
112         'conditions': [
113           ['os_posix == 1 and OS != "mac"', {
114             # -gstabs, used in the official builds, causes an ICE. Remove it.
115             'cflags!': ['-gstabs'],
116           }],
117           ['OS=="mac"', {
118             'mac_bundle': 1,
119             'product_extension': 'plugin',
120           }],
121         ],
122       },
123     },
124     {
125       'target_name': 'hello_triangle_exe',
126       'type': 'executable',
127       'dependencies': [
128         'gpu_demo_framework_exe',
129         '../../third_party/gles2_book/gles2_book.gyp:hello_triangle',
130       ],
131       'sources': [
132         'gles2_book/example.h',
133         'gles2_book/demo_hello_triangle.cc',
134       ],
135     },
136     {
137       'target_name': 'mip_map_2d_exe',
138       'type': 'executable',
139       'dependencies': [
140         'gpu_demo_framework_exe',
141         '../../third_party/gles2_book/gles2_book.gyp:mip_map_2d',
142       ],
143       'sources': [
144         'gles2_book/example.h',
145         'gles2_book/demo_mip_map_2d.cc',
146       ],
147     },
148     {
149       'target_name': 'simple_texture_2d_exe',
150       'type': 'executable',
151       'dependencies': [
152         'gpu_demo_framework_exe',
153         '../../third_party/gles2_book/gles2_book.gyp:simple_texture_2d',
154       ],
155       'sources': [
156         'gles2_book/example.h',
157         'gles2_book/demo_simple_texture_2d.cc',
158       ],
159     },
160     {
161       'target_name': 'simple_texture_cubemap_exe',
162       'type': 'executable',
163       'dependencies': [
164         'gpu_demo_framework_exe',
165         '../../third_party/gles2_book/gles2_book.gyp:simple_texture_cubemap',
166       ],
167       'sources': [
168         'gles2_book/example.h',
169         'gles2_book/demo_simple_texture_cubemap.cc',
170       ],
171     },
172     {
173       'target_name': 'simple_vertex_shader_exe',
174       'type': 'executable',
175       'dependencies': [
176         'gpu_demo_framework_exe',
177         '../../third_party/gles2_book/gles2_book.gyp:simple_vertex_shader',
178       ],
179       'sources': [
180         'gles2_book/example.h',
181         'gles2_book/demo_simple_vertex_shader.cc',
182       ],
183     },
184     {
185       'target_name': 'stencil_test_exe',
186       'type': 'executable',
187       'dependencies': [
188         'gpu_demo_framework_exe',
189         '../../third_party/gles2_book/gles2_book.gyp:stencil_test',
190       ],
191       'sources': [
192         'gles2_book/example.h',
193         'gles2_book/demo_stencil_test.cc',
194       ],
195     },
196     {
197       'target_name': 'texture_wrap_exe',
198       'type': 'executable',
199       'dependencies': [
200         'gpu_demo_framework_exe',
201         '../../third_party/gles2_book/gles2_book.gyp:texture_wrap',
202       ],
203       'sources': [
204         'gles2_book/example.h',
205         'gles2_book/demo_texture_wrap.cc',
206       ],
207     },
208     {
209       'target_name': 'compressed_textures_exe',
210       'type': 'executable',
211       'dependencies': [
212         'gpu_demo_framework_exe',
213         '../../third_party/gles2_book/gles2_book.gyp:es_util',
214       ],
215       'sources': [
216         'compressed_textures/compressed_textures.cc',
217       ],
218     },
219     {
220       'target_name': 'occlusion_query_exe',
221       'type': 'executable',
222       'dependencies': [
223         'gpu_demo_framework_exe',
224         '../../third_party/gles2_book/gles2_book.gyp:es_util',
225       ],
226       'defines': [
227         'GL_GLEXT_PROTOTYPES',
228       ],
229       'sources': [
230         'occlusion_query/occlusion_query.cc',
231       ],
232     },
233   ],
234   'conditions': [
235     ['enable_pepper_demos==1', {
236       'targets': [
237         {
238           'target_name': 'hello_triangle_ppapi',
239           'type': 'loadable_module',
240           'variables': { 'chromium_code': 0, },
241           'dependencies': [ 'gpu_demo_framework_ppapi', ],
242           'sources': [
243             '<@(ppp_entrypoints_sources)',
244             'gles2_book/example.h',
245             'gles2_book/demo_hello_triangle.cc',
246             '../../third_party/gles2_book/Chapter_2/Hello_Triangle/Hello_Triangle.c',
247             '../../third_party/gles2_book/Chapter_2/Hello_Triangle/Hello_Triangle.h',
248           ],
249         },
250         {
251           'target_name': 'mip_map_2d_ppapi',
252           'type': 'loadable_module',
253           'variables': { 'chromium_code': 0, },
254           'dependencies': [ 'gpu_demo_framework_ppapi', ],
255           'sources': [
256             '<@(ppp_entrypoints_sources)',
257             'gles2_book/example.h',
258             'gles2_book/demo_mip_map_2d.cc',
259             '../../third_party/gles2_book/Chapter_9/MipMap2D/MipMap2D.c',
260             '../../third_party/gles2_book/Chapter_9/MipMap2D/MipMap2D.h',
261           ],
262         },
263         {
264           'target_name': 'simple_texture_2d_ppapi',
265           'type': 'loadable_module',
266           'variables': { 'chromium_code': 0, },
267           'dependencies': [ 'gpu_demo_framework_ppapi', ],
268           'sources': [
269             '<@(ppp_entrypoints_sources)',
270             'gles2_book/example.h',
271             'gles2_book/demo_simple_texture_2d.cc',
272             '../../third_party/gles2_book/Chapter_9/Simple_Texture2D/Simple_Texture2D.c',
273             '../../third_party/gles2_book/Chapter_9/Simple_Texture2D/Simple_Texture2D.h',
274           ],
275         },
276         {
277           'target_name': 'simple_texture_cubemap_ppapi',
278           'type': 'loadable_module',
279           'variables': { 'chromium_code': 0, },
280           'dependencies': [ 'gpu_demo_framework_ppapi', ],
281           'sources': [
282             '<@(ppp_entrypoints_sources)',
283             'gles2_book/example.h',
284             'gles2_book/demo_simple_texture_cubemap.cc',
285             '../../third_party/gles2_book/Chapter_9/Simple_TextureCubemap/Simple_TextureCubemap.c',
286             '../../third_party/gles2_book/Chapter_9/Simple_TextureCubemap/Simple_TextureCubemap.h',
287           ],
288         },
289         {
290           'target_name': 'simple_vertex_shader_ppapi',
291           'type': 'loadable_module',
292           'variables': { 'chromium_code': 0, },
293           'dependencies': [ 'gpu_demo_framework_ppapi', ],
294           'sources': [
295             '<@(ppp_entrypoints_sources)',
296             'gles2_book/example.h',
297             'gles2_book/demo_simple_vertex_shader.cc',
298             '../../third_party/gles2_book/Chapter_8/Simple_VertexShader/Simple_VertexShader.c',
299             '../../third_party/gles2_book/Chapter_8/Simple_VertexShader/Simple_VertexShader.h',
300           ],
301         },
302         {
303           'target_name': 'stencil_test_ppapi',
304           'type': 'loadable_module',
305           'variables': { 'chromium_code': 0, },
306           'dependencies': [ 'gpu_demo_framework_ppapi', ],
307           'sources': [
308             '<@(ppp_entrypoints_sources)',
309             'gles2_book/example.h',
310             'gles2_book/demo_stencil_test.cc',
311             '../../third_party/gles2_book/Chapter_11/Stencil_Test/Stencil_Test.c',
312             '../../third_party/gles2_book/Chapter_11/Stencil_Test/Stencil_Test.h',
313           ],
314         },
315         {
316           'target_name': 'texture_wrap_ppapi',
317           'type': 'loadable_module',
318           'variables': { 'chromium_code': 0, },
319           'dependencies': [ 'gpu_demo_framework_ppapi', ],
320           'sources': [
321             '<@(ppp_entrypoints_sources)',
322             'gles2_book/example.h',
323             'gles2_book/demo_texture_wrap.cc',
324             '../../third_party/gles2_book/Chapter_9/TextureWrap/TextureWrap.c',
325             '../../third_party/gles2_book/Chapter_9/TextureWrap/TextureWrap.h',
326           ],
327         },
328       ],
329     }],
330   ],