New tutorial on migrating extension from manifest v1 to manifest v2.
[chromium-blink-merge.git] / gpu / demos / demos.gyp
blob85a8e681ecaaf846f2912eab563893b4d645a8ff
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                 '--enable-accelerated-plugins',
98                 '--register-pepper-plugins='
99                   '<(PRODUCT_DIR)/$(PRODUCT_NAME).plugin;'
100                   'pepper-application/x-gpu-demo',
101                 'file://$(SOURCE_ROOT)/pepper_gpu_demo.html',
102               ],
103              }, { # OS != "mac"
104               'action': [
105                 '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)chrome<(EXECUTABLE_SUFFIX)',
106                 '--enable-accelerated-plugins',
107                 '--register-pepper-plugins=$(TargetPath);'
108                   'pepper-application/x-gpu-demo',
109                 'file://$(ProjectDir)pepper_gpu_demo.html',
110               ],
111             }],
112           ],
113         },
114         'conditions': [
115           ['os_posix == 1 and OS != "mac"', {
116             # -gstabs, used in the official builds, causes an ICE. Remove it.
117             'cflags!': ['-gstabs'],
118           }],
119           ['OS=="mac"', {
120             'mac_bundle': 1,
121             'product_extension': 'plugin',
122           }],
123         ],
124       },
125     },
126     {
127       'target_name': 'hello_triangle_exe',
128       'type': 'executable',
129       'dependencies': [
130         'gpu_demo_framework_exe',
131         '../../third_party/gles2_book/gles2_book.gyp:hello_triangle',
132       ],
133       'sources': [
134         'gles2_book/example.h',
135         'gles2_book/demo_hello_triangle.cc',
136       ],
137     },
138     {
139       'target_name': 'mip_map_2d_exe',
140       'type': 'executable',
141       'dependencies': [
142         'gpu_demo_framework_exe',
143         '../../third_party/gles2_book/gles2_book.gyp:mip_map_2d',
144       ],
145       'sources': [
146         'gles2_book/example.h',
147         'gles2_book/demo_mip_map_2d.cc',
148       ],
149     },
150     {
151       'target_name': 'simple_texture_2d_exe',
152       'type': 'executable',
153       'dependencies': [
154         'gpu_demo_framework_exe',
155         '../../third_party/gles2_book/gles2_book.gyp:simple_texture_2d',
156       ],
157       'sources': [
158         'gles2_book/example.h',
159         'gles2_book/demo_simple_texture_2d.cc',
160       ],
161     },
162     {
163       'target_name': 'simple_texture_cubemap_exe',
164       'type': 'executable',
165       'dependencies': [
166         'gpu_demo_framework_exe',
167         '../../third_party/gles2_book/gles2_book.gyp:simple_texture_cubemap',
168       ],
169       'sources': [
170         'gles2_book/example.h',
171         'gles2_book/demo_simple_texture_cubemap.cc',
172       ],
173     },
174     {
175       'target_name': 'simple_vertex_shader_exe',
176       'type': 'executable',
177       'dependencies': [
178         'gpu_demo_framework_exe',
179         '../../third_party/gles2_book/gles2_book.gyp:simple_vertex_shader',
180       ],
181       'sources': [
182         'gles2_book/example.h',
183         'gles2_book/demo_simple_vertex_shader.cc',
184       ],
185     },
186     {
187       'target_name': 'stencil_test_exe',
188       'type': 'executable',
189       'dependencies': [
190         'gpu_demo_framework_exe',
191         '../../third_party/gles2_book/gles2_book.gyp:stencil_test',
192       ],
193       'sources': [
194         'gles2_book/example.h',
195         'gles2_book/demo_stencil_test.cc',
196       ],
197     },
198     {
199       'target_name': 'texture_wrap_exe',
200       'type': 'executable',
201       'dependencies': [
202         'gpu_demo_framework_exe',
203         '../../third_party/gles2_book/gles2_book.gyp:texture_wrap',
204       ],
205       'sources': [
206         'gles2_book/example.h',
207         'gles2_book/demo_texture_wrap.cc',
208       ],
209     },
210     {
211       'target_name': 'compressed_textures_exe',
212       'type': 'executable',
213       'dependencies': [
214         'gpu_demo_framework_exe',
215         '../../third_party/gles2_book/gles2_book.gyp:es_util',
216       ],
217       'sources': [
218         'compressed_textures/compressed_textures.cc',
219       ],
220     },
221     {
222       'target_name': 'occlusion_query_exe',
223       'type': 'executable',
224       'dependencies': [
225         'gpu_demo_framework_exe',
226         '../../third_party/gles2_book/gles2_book.gyp:es_util',
227       ],
228       'defines': [
229         'GL_GLEXT_PROTOTYPES',
230       ],
231       'sources': [
232         'occlusion_query/occlusion_query.cc',
233       ],
234     },
235   ],
236   'conditions': [
237     ['enable_pepper_demos==1', {
238       'targets': [
239         {
240           'target_name': 'hello_triangle_ppapi',
241           'type': 'loadable_module',
242           'variables': { 'chromium_code': 0, },
243           'dependencies': [ 'gpu_demo_framework_ppapi', ],
244           'sources': [
245             '<@(ppp_entrypoints_sources)',
246             'gles2_book/example.h',
247             'gles2_book/demo_hello_triangle.cc',
248             '../../third_party/gles2_book/Chapter_2/Hello_Triangle/Hello_Triangle.c',
249             '../../third_party/gles2_book/Chapter_2/Hello_Triangle/Hello_Triangle.h',
250           ],
251         },
252         {
253           'target_name': 'mip_map_2d_ppapi',
254           'type': 'loadable_module',
255           'variables': { 'chromium_code': 0, },
256           'dependencies': [ 'gpu_demo_framework_ppapi', ],
257           'sources': [
258             '<@(ppp_entrypoints_sources)',
259             'gles2_book/example.h',
260             'gles2_book/demo_mip_map_2d.cc',
261             '../../third_party/gles2_book/Chapter_9/MipMap2D/MipMap2D.c',
262             '../../third_party/gles2_book/Chapter_9/MipMap2D/MipMap2D.h',
263           ],
264         },
265         {
266           'target_name': 'simple_texture_2d_ppapi',
267           'type': 'loadable_module',
268           'variables': { 'chromium_code': 0, },
269           'dependencies': [ 'gpu_demo_framework_ppapi', ],
270           'sources': [
271             '<@(ppp_entrypoints_sources)',
272             'gles2_book/example.h',
273             'gles2_book/demo_simple_texture_2d.cc',
274             '../../third_party/gles2_book/Chapter_9/Simple_Texture2D/Simple_Texture2D.c',
275             '../../third_party/gles2_book/Chapter_9/Simple_Texture2D/Simple_Texture2D.h',
276           ],
277         },
278         {
279           'target_name': 'simple_texture_cubemap_ppapi',
280           'type': 'loadable_module',
281           'variables': { 'chromium_code': 0, },
282           'dependencies': [ 'gpu_demo_framework_ppapi', ],
283           'sources': [
284             '<@(ppp_entrypoints_sources)',
285             'gles2_book/example.h',
286             'gles2_book/demo_simple_texture_cubemap.cc',
287             '../../third_party/gles2_book/Chapter_9/Simple_TextureCubemap/Simple_TextureCubemap.c',
288             '../../third_party/gles2_book/Chapter_9/Simple_TextureCubemap/Simple_TextureCubemap.h',
289           ],
290         },
291         {
292           'target_name': 'simple_vertex_shader_ppapi',
293           'type': 'loadable_module',
294           'variables': { 'chromium_code': 0, },
295           'dependencies': [ 'gpu_demo_framework_ppapi', ],
296           'sources': [
297             '<@(ppp_entrypoints_sources)',
298             'gles2_book/example.h',
299             'gles2_book/demo_simple_vertex_shader.cc',
300             '../../third_party/gles2_book/Chapter_8/Simple_VertexShader/Simple_VertexShader.c',
301             '../../third_party/gles2_book/Chapter_8/Simple_VertexShader/Simple_VertexShader.h',
302           ],
303         },
304         {
305           'target_name': 'stencil_test_ppapi',
306           'type': 'loadable_module',
307           'variables': { 'chromium_code': 0, },
308           'dependencies': [ 'gpu_demo_framework_ppapi', ],
309           'sources': [
310             '<@(ppp_entrypoints_sources)',
311             'gles2_book/example.h',
312             'gles2_book/demo_stencil_test.cc',
313             '../../third_party/gles2_book/Chapter_11/Stencil_Test/Stencil_Test.c',
314             '../../third_party/gles2_book/Chapter_11/Stencil_Test/Stencil_Test.h',
315           ],
316         },
317         {
318           'target_name': 'texture_wrap_ppapi',
319           'type': 'loadable_module',
320           'variables': { 'chromium_code': 0, },
321           'dependencies': [ 'gpu_demo_framework_ppapi', ],
322           'sources': [
323             '<@(ppp_entrypoints_sources)',
324             'gles2_book/example.h',
325             'gles2_book/demo_texture_wrap.cc',
326             '../../third_party/gles2_book/Chapter_9/TextureWrap/TextureWrap.c',
327             '../../third_party/gles2_book/Chapter_9/TextureWrap/TextureWrap.h',
328           ],
329         },
330       ],
331     }],
332   ],