Adds a debug pref to chrome://instant that allows the user to
[chromium-blink-merge.git] / ppapi / ppapi_untrusted.gyp
blob9f14e122627eb04693f6908c5b7a4c442484986f
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.
5 # This GYP file defines untrusted (NaCl) targets.  All targets in this
6 # file should be conditionally depended upon via 'disable_nacl!=1' to avoid
7 # requiring NaCl sources for building.
10   'includes': [
11     '../native_client/build/untrusted.gypi',
12     'ppapi_sources.gypi',
13   ],
14   'targets': [
15     {
16       'target_name': 'ppapi_cpp_lib',
17       'type': 'none',
18       'variables': {
19         'nlib_target': 'libppapi_cpp.a',
20         'nso_target': 'libppapi_cpp.so',
21         'build_glibc': 1,
22         'build_newlib': 1,
23         'sources': [
24           '<@(cpp_source_files)',
25           'cpp/module_embedder.h',
26           'cpp/ppp_entrypoints.cc',
27         ],
28       },
29       'dependencies': [
30         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
31       ],
32     },
33     {
34       'target_name': 'ppapi_gles2_lib',
35       'type': 'none',
36       'variables': {
37         'nlib_target': 'libppapi_gles2.a',
38         'nso_target': 'libppapi_gles2.so',
39         'build_glibc': 1,
40         'build_newlib': 1,
41         'include_dirs': [
42           'lib/gl/include',
43         ],
44         'sources': [
45           'lib/gl/gles2/gl2ext_ppapi.c',
46           'lib/gl/gles2/gl2ext_ppapi.h',
47           'lib/gl/gles2/gles2.c',
48         ],
49       },
50       'dependencies': [
51         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
52       ],
53     },
54     {
55       'target_name': 'ppapi_nacl_tests',
56       'type': 'none',
57       'dependencies': [
58          '<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:nacl_lib',
59          'ppapi_cpp_lib',
60          'native_client/native_client.gyp:ppapi_lib',
61       ],
62       'variables': {
63         # TODO(bradnelson): Remove this compile flag once new nacl_rev is
64         # above 9362.
65         'compile_flags': [
66           '-DGL_GLEXT_PROTOTYPES',
67         ],
68         'defines': [
69           'GL_GLEXT_PROTOTYPES',
70         ],
71         'nexe_target': 'ppapi_nacl_tests',
72         'build_newlib': 1,
73         'include_dirs': [
74           'lib/gl/include',
75           '..',
76         ],
77         'link_flags': [
78           '-lppapi_cpp',
79           '-lppapi',
80           '-lpthread',
81         ],
82         # TODO(bradchen): get rid of extra_deps64 and extra_deps32
83         # once native_client/build/untrusted.gypi no longer needs them.
84         'extra_deps64': [
85           '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib64/libppapi_cpp.a',
86           '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib64/libppapi.a',
87         ],
88         'extra_deps_newlib64': [
89           '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib64/libppapi_cpp.a',
90           '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib64/libppapi.a',
91         ],
92         'extra_deps_newlib32': [
93           '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib32/libppapi_cpp.a',
94           '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib32/libppapi.a',
95         ],
96         'extra_deps_glibc64': [
97           '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib64/libppapi_cpp.a',
98           '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib64/libppapi.a',
99         ],
100         'extra_deps_glibc32': [
101           '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib32/libppapi_cpp.a',
102           '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib32/libppapi.a',
103         ],
104         'extra_deps_arm': [
105           '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/libarm/libppapi_cpp.a',
106           '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/libarm/libppapi.a',
107         ],
108         'sources': [
109           '<@(test_common_source_files)',
110           '<@(test_nacl_source_files)',
111         ],
112       },
113       'conditions': [
114         ['target_arch!="arm"', {
115           'variables': {
116             'compile_flags': [
117               '-mno-tls-use-call',
118             ],
119           },
120         }],
121         ['target_arch!="arm" and disable_glibc==0', {
122           'variables': {
123             'build_glibc': 1,
124             # NOTE: Use /lib, not /lib64 here; it is a symbolic link which
125             # doesn't work on Windows.
126             'libdir_glibc64': '>(nacl_glibc_tc_root)/x86_64-nacl/lib',
127             'libdir_glibc32': '>(nacl_glibc_tc_root)/x86_64-nacl/lib32',
128             'nacl_objdump': '>(nacl_glibc_tc_root)/bin/x86_64-nacl-objdump',
129             'nmf_glibc%': '<(PRODUCT_DIR)/>(nexe_target)_glibc.nmf',
130           },
131           'actions': [
132           {
133             'action_name': 'Generate GLIBC NMF and copy libs',
134             'inputs': ['>(out_glibc64)', '>(out_glibc32)'],
135             # NOTE: There is no explicit dependency for the lib32
136             # and lib64 directories created in the PRODUCT_DIR.
137             # They are created as a side-effect of NMF creation.
138             'outputs': ['>(nmf_glibc)'],
139             'action': [
140               'python',
141               '<(DEPTH)/native_client_sdk/src/tools/create_nmf.py',
142               '>@(_inputs)',
143               '--objdump=>(nacl_objdump)',
144               '--library-path=>(libdir_glibc64)',
145               '--library-path=>(libdir_glibc32)',
146               '--library-path=<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib32',
147               '--library-path=<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib64',
148               '--output=>(nmf_glibc)',
149               '--stage-dependencies=<(PRODUCT_DIR)',
150               '--toolchain=glibc',
151             ],
152           },
153         ],
154         }],
155       ],
156     },
157   ],