Fix cross-window focus in Chrome Frame.
[chromium-blink-merge.git] / ppapi / ppapi_untrusted.gyp
blob3e19759627f0f64b6af3f65bc2005b56783ce78e
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         'build_pnacl_newlib': 1,
24         'sources': [
25           '<@(cpp_source_files)',
26           'cpp/module_embedder.h',
27           'cpp/ppp_entrypoints.cc',
28         ],
29       },
30       'dependencies': [
31         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
32       ],
33     },
34     {
35       'target_name': 'ppapi_gles2_lib',
36       'type': 'none',
37       'variables': {
38         'nlib_target': 'libppapi_gles2.a',
39         'nso_target': 'libppapi_gles2.so',
40         'build_glibc': 1,
41         'build_newlib': 1,
42         'build_pnacl_newlib': 1,
43         'include_dirs': [
44           'lib/gl/include',
45         ],
46         'sources': [
47           'lib/gl/gles2/gl2ext_ppapi.c',
48           'lib/gl/gles2/gl2ext_ppapi.h',
49           'lib/gl/gles2/gles2.c',
50         ],
51       },
52       'dependencies': [
53         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
54       ],
55     },
56     {
57       'target_name': 'ppapi_nacl_tests',
58       'type': 'none',
59       'dependencies': [
60          '<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:nacl_lib',
61          'ppapi_cpp_lib',
62          'native_client/native_client.gyp:ppapi_lib',
63       ],
64       'variables': {
65         # This is user code (vs IRT code), so tls accesses do not
66         # need to be indirect through a function call.
67         'newlib_tls_flags=': [],
68         # TODO(bradnelson): Remove this compile flag once new nacl_rev is
69         # above 9362.
70         'compile_flags': [
71           '-DGL_GLEXT_PROTOTYPES',
72         ],
73         # Speed up pnacl linking by not generating debug info for tests.
74         # We compile with --strip-all under extra_args so debug info is
75         # discarded anyway.  Remove this and the --strip-all flag if
76         # debug info is really needed.
77        'compile_flags!': [
78           '-g',
79         ],
80         'defines': [
81           'GL_GLEXT_PROTOTYPES',
82         ],
83         'nexe_target': 'ppapi_nacl_tests',
84         'build_newlib': 1,
85         'include_dirs': [
86           'lib/gl/include',
87           '..',
88         ],
89         'link_flags': [
90           '-lppapi_cpp',
91           '-lppapi',
92           '-pthread',
93         ],
94         'link_flags!': [
95           '-O3',
96         ],
97         'translate_flags': [
98           '-O0',
99         ],
100         # TODO(bradchen): get rid of extra_deps64 and extra_deps32
101         # once native_client/build/untrusted.gypi no longer needs them.
102         'extra_deps_newlib64': [
103           '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib64/libppapi_cpp.a',
104           '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib64/libppapi.a',
105         ],
106         'extra_deps_newlib32': [
107           '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib32/libppapi_cpp.a',
108           '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib32/libppapi.a',
109         ],
110         'extra_deps_glibc64': [
111           '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib64/libppapi_cpp.so',
112           '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib64/libppapi.so',
113         ],
114         'extra_deps_glibc32': [
115           '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib32/libppapi_cpp.so',
116           '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib32/libppapi.so',
117         ],
118         'extra_deps_arm': [
119           '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/libarm/libppapi_cpp.a',
120           '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/libarm/libppapi.a',
121         ],
122         'extra_deps_pnacl': [
123           '<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_newlib/lib/libppapi_cpp.a',
124           '<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_newlib/lib/libppapi.a',
125         ],
126         'sources': [
127           '<@(test_common_source_files)',
128           '<@(test_nacl_source_files)',
129         ],
130         'extra_args': [
131           '--strip-all',
132         ],
133       },
134       'conditions': [
135         ['target_arch!="arm" and disable_glibc==0', {
136           'variables': {
137             'build_glibc': 1,
138             # NOTE: Use /lib, not /lib64 here; it is a symbolic link which
139             # doesn't work on Windows.
140             'libdir_glibc64': '>(nacl_glibc_tc_root)/x86_64-nacl/lib',
141             'libdir_glibc32': '>(nacl_glibc_tc_root)/x86_64-nacl/lib32',
142             'nacl_objdump': '>(nacl_glibc_tc_root)/bin/x86_64-nacl-objdump',
143             'nmf_glibc%': '<(PRODUCT_DIR)/>(nexe_target)_glibc.nmf',
144           },
145           'actions': [
146           {
147             'action_name': 'Generate GLIBC NMF and copy libs',
148             'inputs': ['>(out_glibc64)', '>(out_glibc32)'],
149             # NOTE: There is no explicit dependency for the lib32
150             # and lib64 directories created in the PRODUCT_DIR.
151             # They are created as a side-effect of NMF creation.
152             'outputs': ['>(nmf_glibc)'],
153             'action': [
154               'python',
155               '<(DEPTH)/native_client_sdk/src/tools/create_nmf.py',
156               '>@(_inputs)',
157               '--objdump=>(nacl_objdump)',
158               '--library-path=>(libdir_glibc64)',
159               '--library-path=>(libdir_glibc32)',
160               '--library-path=<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib32',
161               '--library-path=<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib64',
162               '--output=>(nmf_glibc)',
163               '--stage-dependencies=<(PRODUCT_DIR)',
164             ],
165             'msvs_cygwin_shell': 1,
166           },
167         ],
168         }],
169         # Test PNaCl pre-translated code (pre-translated to save bot time).
170         # We only care about testing that code generation is correct,
171         # and in-browser translation is tested elsewhere.
172         # NOTE: native_client/build/untrusted.gypi dictates that
173         # PNaCl only generate x86-32 and x86-64 on x86 platforms,
174         # or ARM on ARM platforms, not all versions always.
175         # The same goes for the PNaCl shims. So, we have two variations here.
176         ['disable_pnacl==0 and target_arch!="arm"', {
177           'variables': {
178             'build_pnacl_newlib': 1,
179             'nmf_pnacl%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl.nmf',
180           },
181           # Shim is a dependency for the nexe because we pre-translate.
182           'dependencies': [
183             '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:pnacl_irt_shim',
184           ],
185          'actions': [
186             {
187               'action_name': 'Generate PNACL NEWLIB NMF',
188               'inputs': ['>(out_pnacl_newlib_x86_32_nexe)',
189                          '>(out_pnacl_newlib_x86_64_nexe)'],
190               'outputs': ['>(nmf_pnacl)'],
191               'action': [
192                 'python',
193                 '<(DEPTH)/native_client_sdk/src/tools/create_nmf.py',
194                 '>@(_inputs)',
195                 '--output=>(nmf_pnacl)',
196               ],
197             },
198           ],
199         }],
200         ['disable_pnacl==0 and target_arch=="arm"', {
201           'variables': {
202             'build_pnacl_newlib': 1,
203             'nmf_pnacl%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl.nmf',
204           },
205           # Shim is a dependency for the nexe because we pre-translate.
206           'dependencies': [
207             '<(DEPTH)/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:pnacl_irt_shim',
208           ],
209           'actions': [
210             {
211               'action_name': 'Generate PNACL NEWLIB NMF',
212               'inputs': ['>(out_pnacl_newlib_arm_nexe)'],
213               'outputs': ['>(nmf_pnacl)'],
214               'action': [
215                 'python',
216                 '<(DEPTH)/native_client_sdk/src/tools/create_nmf.py',
217                 '>@(_inputs)',
218                 '--output=>(nmf_pnacl)',
219               ],
220             },
221           ],
222         }],
223       ],
224     },
225   ],