Teach create_nmf.py about new toolchains' BFD format names
[chromium-blink-merge.git] / components / nacl.gyp
blob21fce7901b79661540a8ef220eadb25ce0c4ad95
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     '../native_client/build/untrusted.gypi',
11     'nacl/nacl_defines.gypi',
12   ],
13   'target_defaults': {
14     'variables': {
15       'nacl_target': 0,
16     },
17     'target_conditions': [
18       # This part is shared between the targets defined below. Only files and
19       # settings relevant for building the Win64 target should be added here.
20       ['nacl_target==1', {
21         'include_dirs': [
22           '<(INTERMEDIATE_DIR)',
23         ],
24         'defines': [
25           '<@(nacl_defines)',
26         ],
27         'sources': [
28           # .cc, .h, and .mm files under nacl that are used on all
29           # platforms, including both 32-bit and 64-bit Windows.
30           # Test files are also not included.
31           'nacl/loader/nacl_ipc_adapter.cc',
32           'nacl/loader/nacl_ipc_adapter.h',
33           'nacl/loader/nacl_main.cc',
34           'nacl/loader/nacl_main_platform_delegate.h',
35           'nacl/loader/nacl_main_platform_delegate_linux.cc',
36           'nacl/loader/nacl_main_platform_delegate_mac.mm',
37           'nacl/loader/nacl_main_platform_delegate_win.cc',
38           'nacl/loader/nacl_listener.cc',
39           'nacl/loader/nacl_listener.h',
40           'nacl/loader/nacl_validation_db.h',
41           'nacl/loader/nacl_validation_query.cc',
42           'nacl/loader/nacl_validation_query.h',
43           'nacl/browser/test_nacl_browser_delegate.cc',
44         ],
45         # TODO(gregoryd): consider switching NaCl to use Chrome OS defines
46         'conditions': [
47           ['OS=="win"', {
48             'defines': [
49               '__STDC_LIMIT_MACROS=1',
50             ],
51             'include_dirs': [
52               '<(DEPTH)/third_party/wtl/include',
53             ],
54           },],
55           ['OS=="linux"', {
56             'defines': [
57               '__STDC_LIMIT_MACROS=1',
58             ],
59             'sources': [
60               '../components/nacl/common/nacl_paths.cc',
61               '../components/nacl/common/nacl_paths.h',
62               '../components/nacl/zygote/nacl_fork_delegate_linux.cc',
63               '../components/nacl/zygote/nacl_fork_delegate_linux.h',
64             ],
65           },],
66         ],
67       }],
68     ],
69   },
70   'conditions': [
71     ['disable_nacl!=1', {
72       'targets': [
73         {
74           'target_name': 'nacl',
75           'type': 'static_library',
76           'variables': {
77             'nacl_target': 1,
78           },
79           'dependencies': [
80             '../base/base.gyp:base',
81             '../ipc/ipc.gyp:ipc',
82             '../ppapi/native_client/src/trusted/plugin/plugin.gyp:ppGoogleNaClPluginChrome',
83             '../ppapi/ppapi_internal.gyp:ppapi_shared',
84             '../ppapi/ppapi_internal.gyp:ppapi_ipc',
85             '../native_client/src/trusted/service_runtime/service_runtime.gyp:sel_main_chrome',
86           ],
87           'conditions': [
88             ['disable_nacl_untrusted==0', {
89               'dependencies': [
90                 '../ppapi/native_client/native_client.gyp:nacl_irt',
91                 '../ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:pnacl_irt_shim',
92                 '../ppapi/native_client/src/untrusted/pnacl_support_extension/pnacl_support_extension.gyp:pnacl_support_extension',
93               ],
94             }],
95           ],
96           'direct_dependent_settings': {
97             'defines': [
98               '<@(nacl_defines)',
99             ],
100           },
101         },
102         {
103           'target_name': 'nacl_browser',
104           'type': 'static_library',
105           'sources': [
106             'nacl/browser/nacl_browser.cc',
107             'nacl/browser/nacl_browser.h',
108             'nacl/browser/nacl_validation_cache.cc',
109             'nacl/browser/nacl_validation_cache.h',
110             'nacl/browser/pnacl_translation_cache.cc',
111             'nacl/browser/pnacl_translation_cache.h',
112           ],
113           'include_dirs': [
114             '..',
115           ],
116           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
117           'msvs_disabled_warnings': [4267, ],
118         },
119       ],
120       'conditions': [
121         ['OS=="linux"', {
122           'targets': [
123             {
124               'target_name': 'nacl_helper',
125               'type': 'executable',
126               'include_dirs': [
127                 '..',
128               ],
129               'dependencies': [
130                 'nacl',
131                 'nacl_common.gyp:nacl_common',
132                 '../crypto/crypto.gyp:crypto',
133                 '../sandbox/sandbox.gyp:libc_urandom_override',
134                 '../sandbox/sandbox.gyp:sandbox',
135               ],
136               'defines': [
137                 '<@(nacl_defines)',
138               ],
139               'sources': [
140                 'nacl/loader/nacl_sandbox_linux.cc',
141                 'nacl/loader/nacl_helper_linux.cc',
142                 'nacl/loader/nacl_helper_linux.h',
143                 '../base/posix/unix_domain_socket_linux.cc',
144                 '../content/common/child_process_sandbox_support_impl_shm_linux.cc',
145                 '../content/common/sandbox_init_linux.cc',
146                 '../content/common/sandbox_seccomp_bpf_linux.cc',
147                 '../content/public/common/content_switches.cc',
148               ],
149               'conditions': [
150                 ['toolkit_uses_gtk == 1', {
151                   'dependencies': [
152                     '../build/linux/system.gyp:gtk',
153                   ],
154                 }],
155                 ['use_glib == 1', {
156                   'dependencies': [
157                     '../build/linux/system.gyp:glib',
158                   ],
159                 }],
160                 ['os_posix == 1 and OS != "mac"', {
161                   'conditions': [
162                     ['linux_use_tcmalloc==1', {
163                       'dependencies': [
164                         '../base/allocator/allocator.gyp:allocator',
165                       ],
166                     }],
167                   ],
168                 }],
169               ],
170               'cflags': ['-fPIE'],
171               'link_settings': {
172                 'ldflags': ['-pie'],
173               },
174             },
175           ],
176         }],
177         ['OS=="win" and target_arch=="ia32"', {
178           'targets': [
179             {
180               'target_name': 'nacl_win64',
181               'type': 'static_library',
182               'variables': {
183                 'nacl_target': 1,
184               },
185               'dependencies': [
186                 '../native_client/src/trusted/service_runtime/service_runtime.gyp:sel_main_chrome64',
187                 '../ppapi/ppapi_internal.gyp:ppapi_shared_win64',
188                 '../ppapi/ppapi_internal.gyp:ppapi_ipc_win64',
189                 '../components/nacl_common.gyp:nacl_common_win64',
190               ],
191               'export_dependent_settings': [
192                 '../ppapi/ppapi_internal.gyp:ppapi_ipc_win64',
193               ],
194               'sources': [
195                 '../components/nacl/broker/nacl_broker_listener.cc',
196                 '../components/nacl/broker/nacl_broker_listener.h',
197                 '../components/nacl/common/nacl_debug_exception_handler_win.cc',
198                 '../components/nacl/loader/nacl_helper_win_64.cc',
199                 '../components/nacl/loader/nacl_helper_win_64.h',
200               ],
201               'include_dirs': [
202                 '..',
203               ],
204               'defines': [
205                 '<@(nacl_win64_defines)',
206                 'COMPILE_CONTENT_STATICALLY',
207               ],
208               'configurations': {
209                 'Common_Base': {
210                   'msvs_target_platform': 'x64',
211                 },
212               },
213               'direct_dependent_settings': {
214                 'defines': [
215                   '<@(nacl_defines)',
216                 ],
217               },
218             },
219           ],
220         }],
221       ],
222     }, {  # else (disable_nacl==1)
223       'targets': [
224         {
225           'target_name': 'nacl',
226           'type': 'none',
227           'sources': [],
228         },
229       ],
230       'conditions': [
231         ['OS=="win"', {
232           'targets': [
233             {
234               'target_name': 'nacl_win64',
235               'type': 'none',
236               'sources': [],
237             },
238           ],
239         }],
240       ],
241     }],
242   ],