Disable view source for Developer Tools.
[chromium-blink-merge.git] / components / nacl.gyp
blob5b7b2857d0451178c29e24cc1f0223b68f508d00
1 # Copyright 2013 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   'variables': {
7     'chromium_code': 1,
8   },
9   'includes': [
10     'nacl/nacl_defines.gypi',
11   ],
12   'target_defaults': {
13     'variables': {
14       'nacl_target': 0,
15     },
16     'target_conditions': [
17       # This part is shared between the targets defined below. Only files and
18       # settings relevant for building the Win64 target should be added here.
19       ['nacl_target==1', {
20         'include_dirs': [
21           '<(INTERMEDIATE_DIR)',
22         ],
23         'defines': [
24           '<@(nacl_defines)',
25         ],
26         'sources': [
27           # .cc, .h, and .mm files under nacl that are used on all
28           # platforms, including both 32-bit and 64-bit Windows.
29           # Test files are also not included.
30           'nacl/loader/nacl_ipc_adapter.cc',
31           'nacl/loader/nacl_ipc_adapter.h',
32           'nacl/loader/nacl_main.cc',
33           'nacl/loader/nacl_main_platform_delegate.h',
34           'nacl/loader/nacl_main_platform_delegate_linux.cc',
35           'nacl/loader/nacl_main_platform_delegate_mac.mm',
36           'nacl/loader/nacl_main_platform_delegate_win.cc',
37           'nacl/loader/nacl_listener.cc',
38           'nacl/loader/nacl_listener.h',
39           'nacl/loader/nacl_validation_db.h',
40           'nacl/loader/nacl_validation_query.cc',
41           'nacl/loader/nacl_validation_query.h',
42         ],
43         # TODO(gregoryd): consider switching NaCl to use Chrome OS defines
44         'conditions': [
45           ['OS=="win"', {
46             'defines': [
47               '__STDC_LIMIT_MACROS=1',
48             ],
49             'include_dirs': [
50               '<(DEPTH)/third_party/wtl/include',
51             ],
52           },],
53           ['OS=="linux"', {
54             'defines': [
55               '__STDC_LIMIT_MACROS=1',
56             ],
57             'sources': [
58               '../components/nacl/common/nacl_paths.cc',
59               '../components/nacl/common/nacl_paths.h',
60               '../components/nacl/zygote/nacl_fork_delegate_linux.cc',
61               '../components/nacl/zygote/nacl_fork_delegate_linux.h',
62             ],
63           },],
64         ],
65       }],
66     ],
67   },
68   'conditions': [
69     ['disable_nacl!=1', {
70       'targets': [
71         {
72           'target_name': 'nacl',
73           'type': 'static_library',
74           'variables': {
75             'nacl_target': 1,
76           },
77           'dependencies': [
78             '../base/base.gyp:base',
79             '../ipc/ipc.gyp:ipc',
80             '../ppapi/native_client/src/trusted/plugin/plugin.gyp:ppGoogleNaClPluginChrome',
81             '../ppapi/ppapi_internal.gyp:ppapi_shared',
82             '../ppapi/ppapi_internal.gyp:ppapi_ipc',
83             '../native_client/src/trusted/service_runtime/service_runtime.gyp:sel_main_chrome',
84           ],
85           'conditions': [
86             ['disable_nacl_untrusted==0', {
87               'dependencies': [
88                 '../ppapi/native_client/native_client.gyp:nacl_irt',
89                 '../ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:pnacl_irt_shim',
90                 '../ppapi/native_client/src/untrusted/pnacl_support_extension/pnacl_support_extension.gyp:pnacl_support_extension',
91               ],
92             }],
93           ],
94           'direct_dependent_settings': {
95             'defines': [
96               '<@(nacl_defines)',
97             ],
98           },
99         },
100         {
101           'target_name': 'nacl_browser',
102           'type': 'static_library',
103           'sources': [
104             'nacl/browser/nacl_broker_host_win.cc',
105             'nacl/browser/nacl_broker_host_win.h',
106             'nacl/browser/nacl_broker_service_win.cc',
107             'nacl/browser/nacl_broker_service_win.h',
108             'nacl/browser/nacl_browser.cc',
109             'nacl/browser/nacl_browser.h',
110             'nacl/browser/nacl_file_host.cc',
111             'nacl/browser/nacl_file_host.h',
112             'nacl/browser/nacl_host_message_filter.cc',
113             'nacl/browser/nacl_host_message_filter.h',
114             'nacl/browser/nacl_process_host.cc',
115             'nacl/browser/nacl_process_host.h',
116             'nacl/browser/nacl_validation_cache.cc',
117             'nacl/browser/nacl_validation_cache.h',
118             'nacl/browser/pnacl_host.cc',
119             'nacl/browser/pnacl_host.h',
120             'nacl/browser/pnacl_translation_cache.cc',
121             'nacl/browser/pnacl_translation_cache.h',
122             'nacl/common/nacl_debug_exception_handler_win.cc',
123             'nacl/common/nacl_debug_exception_handler_win.h',
124           ],
125           'include_dirs': [
126             '..',
127           ],
128           'dependencies': [
129             'nacl_common',
130             'nacl_switches',
131             '../native_client/src/trusted/service_runtime/service_runtime.gyp:sel',
132             '../content/content.gyp:content_browser',
133           ],
134           'defines': [
135             '<@(nacl_defines)',
136           ],
137           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
138           'msvs_disabled_warnings': [4267, ],
139         },
140         {
141           'target_name': 'nacl_renderer',
142           'type': 'static_library',
143           'sources': [
144             'nacl/renderer/pnacl_translation_resource_host.cc',
145             'nacl/renderer/pnacl_translation_resource_host.h',
146             'nacl/renderer/ppb_nacl_private_impl.cc',
147             'nacl/renderer/ppb_nacl_private_impl.h',
148           ],
149           'include_dirs': [
150             '..',
151           ],
152           'dependencies': [
153             '../content/content.gyp:content_renderer',
154             '../third_party/WebKit/public/blink.gyp:blink',
155             '../webkit/common/webkit_common.gyp:webkit_common',
156           ],
157           'defines': [
158             '<@(nacl_defines)',
159           ],
160           'direct_dependent_settings': {
161             'defines': [
162               '<@(nacl_defines)',
163             ],
164           },
165         }
166       ],
167       'conditions': [
168         ['OS=="linux"', {
169           'targets': [
170             {
171               'target_name': 'nacl_helper',
172               'type': 'executable',
173               'include_dirs': [
174                 '..',
175               ],
176               'dependencies': [
177                 'nacl',
178                 'nacl_common',
179                 '../crypto/crypto.gyp:crypto',
180                 '../sandbox/sandbox.gyp:libc_urandom_override',
181                 '../sandbox/sandbox.gyp:sandbox',
182               ],
183               'defines': [
184                 '<@(nacl_defines)',
185                 # Allow .cc files to know if they're being compiled as part
186                 # of nacl_helper.
187                 'IN_NACL_HELPER=1',
188               ],
189               'sources': [
190                 'nacl/loader/nacl_helper_linux.cc',
191                 'nacl/loader/nacl_helper_linux.h',
192                 'nacl/loader/nacl_sandbox_linux.cc',
193                 'nacl/loader/nonsfi/abi_conversion.cc',
194                 'nacl/loader/nonsfi/abi_conversion.h',
195                 'nacl/loader/nonsfi/elf_loader.cc',
196                 'nacl/loader/nonsfi/elf_loader.h',
197                 'nacl/loader/nonsfi/irt_basic.cc',
198                 'nacl/loader/nonsfi/irt_clock.cc',
199                 'nacl/loader/nonsfi/irt_fdio.cc',
200                 'nacl/loader/nonsfi/irt_futex.cc',
201                 'nacl/loader/nonsfi/irt_interfaces.cc',
202                 'nacl/loader/nonsfi/irt_interfaces.h',
203                 'nacl/loader/nonsfi/irt_thread.cc',
204                 'nacl/loader/nonsfi/nonsfi_main.cc',
205                 'nacl/loader/nonsfi/nonsfi_main.h',
206                 '../base/posix/unix_domain_socket_linux.cc',
207                 '../content/common/child_process_sandbox_support_impl_shm_linux.cc',
208                 '../content/common/sandbox_linux/sandbox_bpf_base_policy_linux.cc',
209                 '../content/common/sandbox_linux/sandbox_init_linux.cc',
210                 '../content/common/sandbox_linux/sandbox_seccomp_bpf_linux.cc',
211                 '../content/public/common/content_switches.cc',
212               ],
213               'conditions': [
214                 ['toolkit_uses_gtk == 1', {
215                   'dependencies': [
216                     '../build/linux/system.gyp:gtk',
217                   ],
218                 }],
219                 ['use_glib == 1', {
220                   'dependencies': [
221                     '../build/linux/system.gyp:glib',
222                   ],
223                 }],
224                 ['os_posix == 1 and OS != "mac"', {
225                   'conditions': [
226                     ['linux_use_tcmalloc==1', {
227                       'dependencies': [
228                         '../base/allocator/allocator.gyp:allocator',
229                       ],
230                     }],
231                   ],
232                 }],
233                 ['use_seccomp_bpf == 0', {
234                   'sources!': [
235                     '../content/common/sandbox_linux/sandbox_bpf_base_policy_linux.cc',
236                     '../content/common/sandbox_linux/sandbox_init_linux.cc',
237                   ],
238                 }, {
239                   'defines': ['USE_SECCOMP_BPF'],
240                 }],
241               ],
242               'cflags': ['-fPIE'],
243               'link_settings': {
244                 'ldflags': ['-pie'],
245               },
246             },
247           ],
248         }],
249         ['OS=="win" and target_arch=="ia32"', {
250           'targets': [
251             {
252               'target_name': 'nacl_win64',
253               'type': 'static_library',
254               'variables': {
255                 'nacl_target': 1,
256               },
257               'dependencies': [
258                 'nacl_common_win64',
259                 '../native_client/src/trusted/service_runtime/service_runtime.gyp:sel_main_chrome64',
260                 '../ppapi/ppapi_internal.gyp:ppapi_shared_win64',
261                 '../ppapi/ppapi_internal.gyp:ppapi_ipc_win64',
262               ],
263               'export_dependent_settings': [
264                 '../ppapi/ppapi_internal.gyp:ppapi_ipc_win64',
265               ],
266               'sources': [
267                 '../components/nacl/broker/nacl_broker_listener.cc',
268                 '../components/nacl/broker/nacl_broker_listener.h',
269                 '../components/nacl/common/nacl_debug_exception_handler_win.cc',
270                 '../components/nacl/loader/nacl_helper_win_64.cc',
271                 '../components/nacl/loader/nacl_helper_win_64.h',
272               ],
273               'include_dirs': [
274                 '..',
275               ],
276               'defines': [
277                 '<@(nacl_win64_defines)',
278                 'COMPILE_CONTENT_STATICALLY',
279               ],
280               'configurations': {
281                 'Common_Base': {
282                   'msvs_target_platform': 'x64',
283                 },
284               },
285               'direct_dependent_settings': {
286                 'defines': [
287                   '<@(nacl_defines)',
288                 ],
289               },
290             },
291             {
292               'target_name': 'nacl_switches_win64',
293               'type': 'static_library',
294               'sources': [
295                 'nacl/common/nacl_switches.cc',
296                 'nacl/common/nacl_switches.h',
297               ],
298               'include_dirs': [
299                 '..',
300               ],
301               'configurations': {
302                 'Common_Base': {
303                   'msvs_target_platform': 'x64',
304                 },
305               },
306             },
307             {
308               'target_name': 'nacl_common_win64',
309               'type': 'static_library',
310               'defines': [
311                 'COMPILE_CONTENT_STATICALLY',
312               ],
313               'sources': [
314                 'nacl/common/nacl_cmd_line.cc',
315                 'nacl/common/nacl_cmd_line.h',
316                 'nacl/common/nacl_messages.cc',
317                 'nacl/common/nacl_messages.h',
318                 'nacl/common/nacl_types.cc',
319                 'nacl/common/nacl_types.h',
320               ],
321               'include_dirs': [
322                 '..',
323               ],
324               'configurations': {
325                 'Common_Base': {
326                   'msvs_target_platform': 'x64',
327                 },
328               },
329             },
330           ],
331         }],
332       ],
333     }, {  # else (disable_nacl==1)
334       'targets': [
335         {
336           'target_name': 'nacl',
337           'type': 'none',
338           'sources': [],
339         },
340       ],
341       'conditions': [
342         ['OS=="win"', {
343           'targets': [
344             {
345               'target_name': 'nacl_win64',
346               'type': 'none',
347               'sources': [],
348             },
349             {
350               'target_name': 'nacl_switches_win64',
351               'type': 'none',
352               'sources': [],
353             },
354           ],
355         }],
356       ],
357     }],
358   ],
359   'targets': [
360     {
361       'target_name': 'nacl_switches',
362       'type': 'static_library',
363       'sources': [
364         'nacl/common/nacl_switches.cc',
365         'nacl/common/nacl_switches.h',
366     ],
367       'include_dirs': [
368         '..',
369       ],
370     },
371     {
372       'target_name': 'nacl_common',
373       'type': 'static_library',
374       'sources': [
375         'nacl/common/nacl_cmd_line.cc',
376         'nacl/common/nacl_cmd_line.h',
377         'nacl/common/nacl_host_messages.h',
378         'nacl/common/nacl_host_messages.cc',
379         'nacl/common/nacl_messages.cc',
380         'nacl/common/nacl_messages.h',
381         'nacl/common/nacl_process_type.h',
382         'nacl/common/nacl_sandbox_type_mac.h',
383         'nacl/common/nacl_types.cc',
384         'nacl/common/nacl_types.h',
385         'nacl/common/pnacl_types.cc',
386         'nacl/common/pnacl_types.h',
387       ],
388       'include_dirs': [
389         '..',
390       ],
391     },
392   ]