diff options
Diffstat (limited to 'gpu/demos/demos.gyp')
-rw-r--r-- | gpu/demos/demos.gyp | 244 |
1 files changed, 137 insertions, 107 deletions
diff --git a/gpu/demos/demos.gyp b/gpu/demos/demos.gyp index 10d3cba..d69ae75c 100644 --- a/gpu/demos/demos.gyp +++ b/gpu/demos/demos.gyp @@ -5,6 +5,18 @@ { 'variables': { 'chromium_code': 1, + 'conditions': [ + # Pepper demos that are compiled as shared libraries need to be compiled + # with -fPIC flag. All static libraries that these demos depend on must + # also be compiled with -fPIC flag. Setting GYP_DEFINES="linux_fpic=1" + # compiles everything with -fPIC. Disable pepper demos on linux/x64 + # unless linux_fpic is 1. + ['OS=="linux" and (target_arch=="x64" or target_arch=="arm") and linux_fpic!=1', { + 'enable_pepper_demos%': 0, + }, { + 'enable_pepper_demos%': 1, + }], + ], }, 'includes': [ '../../build/common.gypi', @@ -30,16 +42,18 @@ '../gpu.gyp:command_buffer_client', '../gpu.gyp:command_buffer_service', ], - 'all_dependent_settings': { - 'sources': [ - 'framework/main_exe.cc', - ], - }, 'sources': [ - 'framework/platform.h', 'framework/window.cc', 'framework/window.h', ], + 'conditions': [ + ['OS=="linux"', {'sources': ['framework/window_linux.cc']}], + ['OS=="mac"', {'sources': ['framework/window_mac.mm']}], + ['OS=="win"', {'sources': ['framework/window_win.cc']}], + ], + 'direct_dependent_settings': { + 'sources': ['framework/main_exe.cc'], + }, }, { 'target_name': 'gpu_demo_framework_pepper', @@ -48,27 +62,37 @@ 'gpu_demo_framework', '../gpu.gyp:pgl', ], - 'all_dependent_settings': { - 'sources': [ - 'framework/main_pepper.cc', - 'framework/plugin.def', - 'framework/plugin.rc', - ], - 'run_as': { - 'action': [ - '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)chrome<(EXECUTABLE_SUFFIX)', - '--no-sandbox', - '--internal-pepper', - '--enable-gpu-plugin', - '--load-plugin=$(TargetPath)', - 'file://$(ProjectDir)pepper_gpu_demo.html', - ], - }, - }, 'sources': [ 'framework/plugin.cc', 'framework/plugin.h', ], + 'direct_dependent_settings': { + 'sources': [ + 'framework/main_pepper.cc', + ], + 'conditions': [ + ['OS=="win"', { + 'sources': [ + 'framework/plugin.def', + 'framework/plugin.rc', + ], + 'run_as': { + 'action': [ + '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)chrome<(EXECUTABLE_SUFFIX)', + '--no-sandbox', + '--internal-pepper', + '--enable-gpu-plugin', + '--load-plugin=$(TargetPath)', + 'file://$(ProjectDir)pepper_gpu_demo.html', + ], + }, + }], + ['OS=="linux"', { + # -gstabs, used in the official builds, causes an ICE. Remove it. + 'cflags!': ['-gstabs'], + }], + ], + }, }, { 'target_name': 'hello_triangle_exe', @@ -83,18 +107,6 @@ ], }, { - 'target_name': 'hello_triangle_pepper', - 'type': 'shared_library', - 'dependencies': [ - 'gpu_demo_framework_pepper', - '../../third_party/gles2_book/gles2_book.gyp:hello_triangle', - ], - 'sources': [ - 'gles2_book/example.h', - 'gles2_book/hello_triangle.cc', - ], - }, - { 'target_name': 'mip_map_2d_exe', 'type': 'executable', 'dependencies': [ @@ -107,18 +119,6 @@ ], }, { - 'target_name': 'mip_map_2d_pepper', - 'type': 'shared_library', - 'dependencies': [ - 'gpu_demo_framework_pepper', - '../../third_party/gles2_book/gles2_book.gyp:mip_map_2d', - ], - 'sources': [ - 'gles2_book/example.h', - 'gles2_book/mip_map_2d.cc', - ], - }, - { 'target_name': 'simple_texture_2d_exe', 'type': 'executable', 'dependencies': [ @@ -131,18 +131,6 @@ ], }, { - 'target_name': 'simple_texture_2d_pepper', - 'type': 'shared_library', - 'dependencies': [ - 'gpu_demo_framework_pepper', - '../../third_party/gles2_book/gles2_book.gyp:simple_texture_2d', - ], - 'sources': [ - 'gles2_book/example.h', - 'gles2_book/simple_texture_2d.cc', - ], - }, - { 'target_name': 'simple_texture_cubemap_exe', 'type': 'executable', 'dependencies': [ @@ -155,18 +143,6 @@ ], }, { - 'target_name': 'simple_texture_cubemap_pepper', - 'type': 'shared_library', - 'dependencies': [ - 'gpu_demo_framework_pepper', - '../../third_party/gles2_book/gles2_book.gyp:simple_texture_cubemap', - ], - 'sources': [ - 'gles2_book/example.h', - 'gles2_book/simple_texture_cubemap.cc', - ], - }, - { 'target_name': 'simple_vertex_shader_exe', 'type': 'executable', 'dependencies': [ @@ -179,18 +155,6 @@ ], }, { - 'target_name': 'simple_vertex_shader_pepper', - 'type': 'shared_library', - 'dependencies': [ - 'gpu_demo_framework_pepper', - '../../third_party/gles2_book/gles2_book.gyp:simple_vertex_shader', - ], - 'sources': [ - 'gles2_book/example.h', - 'gles2_book/simple_vertex_shader.cc', - ], - }, - { 'target_name': 'stencil_test_exe', 'type': 'executable', 'dependencies': [ @@ -203,18 +167,6 @@ ], }, { - 'target_name': 'stencil_test_pepper', - 'type': 'shared_library', - 'dependencies': [ - 'gpu_demo_framework_pepper', - '../../third_party/gles2_book/gles2_book.gyp:stencil_test', - ], - 'sources': [ - 'gles2_book/example.h', - 'gles2_book/stencil_test.cc', - ], - }, - { 'target_name': 'texture_wrap_exe', 'type': 'executable', 'dependencies': [ @@ -226,19 +178,97 @@ 'gles2_book/texture_wrap.cc', ], }, - { - 'target_name': 'texture_wrap_pepper', - 'type': 'shared_library', - 'dependencies': [ - 'gpu_demo_framework_pepper', - '../../third_party/gles2_book/gles2_book.gyp:texture_wrap', - ], - 'sources': [ - 'gles2_book/example.h', - 'gles2_book/texture_wrap.cc', + ], + 'conditions': [ + ['enable_pepper_demos==1', { + 'targets': [ + { + 'target_name': 'hello_triangle_pepper', + 'type': 'shared_library', + 'dependencies': [ + 'gpu_demo_framework_pepper', + '../../third_party/gles2_book/gles2_book.gyp:hello_triangle', + ], + 'sources': [ + 'gles2_book/example.h', + 'gles2_book/hello_triangle.cc', + ], + }, + { + 'target_name': 'mip_map_2d_pepper', + 'type': 'shared_library', + 'dependencies': [ + 'gpu_demo_framework_pepper', + '../../third_party/gles2_book/gles2_book.gyp:mip_map_2d', + ], + 'sources': [ + 'gles2_book/example.h', + 'gles2_book/mip_map_2d.cc', + ], + }, + { + 'target_name': 'simple_texture_2d_pepper', + 'type': 'shared_library', + 'dependencies': [ + 'gpu_demo_framework_pepper', + '../../third_party/gles2_book/gles2_book.gyp:simple_texture_2d', + ], + 'sources': [ + 'gles2_book/example.h', + 'gles2_book/simple_texture_2d.cc', + ], + }, + { + 'target_name': 'simple_texture_cubemap_pepper', + 'type': 'shared_library', + 'dependencies': [ + 'gpu_demo_framework_pepper', + '../../third_party/gles2_book/gles2_book.gyp:simple_texture_cubemap', + ], + 'sources': [ + 'gles2_book/example.h', + 'gles2_book/simple_texture_cubemap.cc', + ], + }, + { + 'target_name': 'simple_vertex_shader_pepper', + 'type': 'shared_library', + 'dependencies': [ + 'gpu_demo_framework_pepper', + '../../third_party/gles2_book/gles2_book.gyp:simple_vertex_shader', + ], + 'sources': [ + 'gles2_book/example.h', + 'gles2_book/simple_vertex_shader.cc', + ], + }, + { + 'target_name': 'stencil_test_pepper', + 'type': 'shared_library', + 'dependencies': [ + 'gpu_demo_framework_pepper', + '../../third_party/gles2_book/gles2_book.gyp:stencil_test', + ], + 'sources': [ + 'gles2_book/example.h', + 'gles2_book/stencil_test.cc', + ], + }, + { + 'target_name': 'texture_wrap_pepper', + 'type': 'shared_library', + 'dependencies': [ + 'gpu_demo_framework_pepper', + '../../third_party/gles2_book/gles2_book.gyp:texture_wrap', + ], + 'sources': [ + 'gles2_book/example.h', + 'gles2_book/texture_wrap.cc', + ], + }, ], - }, - ] + }], + ], } # Local Variables: |