Automated Commit: Committing new LKGM version 6953.0.0 for chromeos.
[chromium-blink-merge.git] / components / nacl / BUILD.gn
blobcb4496f20ddf0298c357c2f1dc127b5066d417a8
1 # Copyright (c) 2015 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 import("//build/config/features.gni")
6 import("//build/config/ui.gni")
7 import("//testing/test.gni")
9 if (enable_nacl) {
10   source_set("nacl") {
11     sources = [
12       "loader/nacl_ipc_adapter.cc",
13       "loader/nacl_ipc_adapter.h",
14       "loader/nacl_listener.cc",
15       "loader/nacl_listener.h",
16       "loader/nacl_main.cc",
17       "loader/nacl_main_platform_delegate.h",
18       "loader/nacl_main_platform_delegate_linux.cc",
19       "loader/nacl_main_platform_delegate_mac.mm",
20       "loader/nacl_main_platform_delegate_win.cc",
21       "loader/nacl_trusted_listener.cc",
22       "loader/nacl_trusted_listener.h",
23       "loader/nacl_validation_db.h",
24       "loader/nacl_validation_query.cc",
25       "loader/nacl_validation_query.h",
26     ]
28     deps = [
29       ":nacl_common",
30       ":nacl_switches",
31       "//base",
32       "//base:base_static",
33       "//content/public/common",
34       "//crypto",
35       "//ipc",
36       "//mojo/nacl:monacl_sel",
37       "//native_client/src/trusted/service_runtime:sel_main_chrome",
38       "//ppapi/c",
39       "//ppapi/proxy:ipc",
40       "//ppapi/shared_impl",
41       "//third_party/mojo/src/mojo/edk/embedder",
42     ]
44     if (enable_nacl_untrusted) {
45       data_deps = [
46         # TODO(GYP): handle other architectures correctly.
47         "//ppapi/native_client:nacl_irt(//native_client/build/toolchain/nacl:irt_x64)",
48       ]
49     }
50     if (enable_pnacl) {
51       data_deps += [
52         # TODO(GYP): handle other architectures correctly.
53         "//ppapi/native_client/src/untrusted/pnacl_support_extension",
54       ]
55     }
56   }
58   source_set("nacl_browser") {
59     sources = [
60       "browser/nacl_broker_host_win.cc",
61       "browser/nacl_broker_host_win.h",
62       "browser/nacl_broker_service_win.cc",
63       "browser/nacl_broker_service_win.h",
64       "browser/nacl_browser.cc",
65       "browser/nacl_browser.h",
66       "browser/nacl_file_host.cc",
67       "browser/nacl_file_host.h",
68       "browser/nacl_host_message_filter.cc",
69       "browser/nacl_host_message_filter.h",
70       "browser/nacl_process_host.cc",
71       "browser/nacl_process_host.h",
72       "browser/nacl_validation_cache.cc",
73       "browser/nacl_validation_cache.h",
74       "browser/pnacl_host.cc",
75       "browser/pnacl_host.h",
76       "browser/pnacl_translation_cache.cc",
77       "browser/pnacl_translation_cache.h",
78       "common/nacl_debug_exception_handler_win.cc",
79       "common/nacl_debug_exception_handler_win.h",
80     ]
82     deps = [
83       ":nacl_common",
84       ":nacl_switches",
85       ":nacl_helper",
86       "//base",
87       "//base/third_party/dynamic_annotations",
88       "//content/public/browser",
89       "//content/public/common",
90       "//ipc",
91       "//native_client/src/trusted/service_runtime:sel_main_chrome",
92       "//net",
93       "//ppapi/host",
94       "//ppapi/proxy:ipc",
95       "//ppapi/shared_impl",
96       "//sandbox/linux:sandbox_services",
97     ]
99     if (is_linux) {
100       sources += [
101         "zygote/nacl_fork_delegate_linux.cc",
102         "zygote/nacl_fork_delegate_linux.h",
103       ]
105       deps += [ "//sandbox/linux:suid_sandbox_client" ]
106     }
107   }
109   source_set("nacl_renderer") {
110     sources = [
111       "renderer/file_downloader.cc",
112       "renderer/file_downloader.h",
113       "renderer/histogram.cc",
114       "renderer/histogram.h",
115       "renderer/json_manifest.cc",
116       "renderer/json_manifest.h",
117       "renderer/manifest_downloader.cc",
118       "renderer/manifest_downloader.h",
119       "renderer/manifest_service_channel.cc",
120       "renderer/manifest_service_channel.h",
121       "renderer/nacl_helper.cc",
122       "renderer/nacl_helper.h",
123       "renderer/nexe_load_manager.cc",
124       "renderer/nexe_load_manager.h",
125       "renderer/platform_info.cc",
126       "renderer/platform_info.h",
127       "renderer/pnacl_translation_resource_host.cc",
128       "renderer/pnacl_translation_resource_host.h",
129       "renderer/ppb_nacl_private_impl.cc",
130       "renderer/ppb_nacl_private_impl.h",
131       "renderer/progress_event.cc",
132       "renderer/progress_event.h",
133       "renderer/trusted_plugin_channel.cc",
134       "renderer/trusted_plugin_channel.h",
135     ]
137     deps = [
138       ":nacl_common",
139       ":nacl_switches",
140       "renderer/plugin:nacl_trusted_plugin",
141       "//base",
142       "//content/public/common",
143       "//content/public/renderer",
144       "//ipc",
145       "//net",
146       "//ppapi/c",
147       "//ppapi/proxy:ipc",
148       "//ppapi/shared_impl",
149       "//third_party/WebKit/public:blink",
150       "//third_party/jsoncpp",
151     ]
152   }
154   test("nacl_loader_unittests") {
155     sources = [
156       "loader/nacl_ipc_adapter_unittest.cc",
157       "loader/nacl_validation_query_unittest.cc",
158       "loader/run_all_unittests.cc",
159     ]
161     deps = [
162       ":nacl",
163       "//base/test:test_support",
164       "//ipc:test_support",
165       "//testing/gtest",
166     ]
167   }
169   if (is_linux) {
170     executable("nacl_helper") {
171       sources = [
172         "loader/nacl_helper_linux.cc",
173         "loader/nacl_helper_linux.h",
174       ]
176       deps = [
177         ":nacl",
178         ":nacl_linux",
179         ":nacl_switches",
180         "//base",
181         "//content/public/common",
182         "//crypto",
183         "//ipc",
184         "//mojo/nacl:monacl_sel",
185         "//sandbox/linux:libc_urandom_override",
186       ]
188       cflags = [ "-fPIE" ]
190       ldflags = [ "-pie" ]
191     }
193     source_set("nacl_linux") {
194       sources = [
195         "//ppapi/nacl_irt/irt_manifest.h",
196         "//ppapi/nacl_irt/manifest_service.cc",
197         "//ppapi/nacl_irt/manifest_service.h",
198         "//ppapi/nacl_irt/plugin_main.cc",
199         "//ppapi/nacl_irt/plugin_main.h",
200         "//ppapi/nacl_irt/plugin_startup.cc",
201         "//ppapi/nacl_irt/plugin_startup.h",
202         "//ppapi/nacl_irt/ppapi_dispatcher.cc",
203         "//ppapi/nacl_irt/ppapi_dispatcher.h",
204         "loader/nonsfi/abi_conversion.cc",
205         "loader/nonsfi/abi_conversion.h",
206         "loader/nonsfi/elf_loader.cc",
207         "loader/nonsfi/elf_loader.h",
208         "loader/nonsfi/irt_basic.cc",
209         "loader/nonsfi/irt_clock.cc",
210         "loader/nonsfi/irt_exception_handling.cc",
211         "loader/nonsfi/irt_fdio.cc",
212         "loader/nonsfi/irt_futex.cc",
213         "loader/nonsfi/irt_icache.cc",
214         "loader/nonsfi/irt_interfaces.cc",
215         "loader/nonsfi/irt_interfaces.h",
216         "loader/nonsfi/irt_memory.cc",
217         "loader/nonsfi/irt_ppapi.cc",
218         "loader/nonsfi/irt_random.cc",
219         "loader/nonsfi/irt_resource_open.cc",
220         "loader/nonsfi/irt_thread.cc",
221         "loader/nonsfi/irt_util.h",
222         "loader/nonsfi/nonsfi_listener.cc",
223         "loader/nonsfi/nonsfi_listener.h",
224         "loader/nonsfi/nonsfi_main.cc",
225         "loader/nonsfi/nonsfi_main.h",
226         "loader/nonsfi/nonsfi_sandbox.cc",
227         "loader/nonsfi/nonsfi_sandbox.h",
228         "loader/sandbox_linux/nacl_bpf_sandbox_linux.cc",
229         "loader/sandbox_linux/nacl_sandbox_linux.cc",
230       ]
232       defines = [ "IN_NACL_HELPER=1" ]
234       deps = [
235         ":nacl",
236         ":nacl_common",
237         ":nacl_switches",
238         "//base",
239         "//components/tracing",
240         "//content/public/common",
241         "//crypto",
242         "//ipc",
243         "//ppapi/c",
244         "//ppapi/proxy",
245         "//ppapi/shared_impl",
246         "//sandbox",
247         "//sandbox/linux:libc_urandom_override",
248         "//sandbox/linux:sandbox_services_headers",
249       ]
251       if (use_glib) {
252         configs += [ "//build/config/linux:glib" ]
253       }
255       if (use_seccomp_bpf) {
256         defines += [ "USE_SECCOMP_BPF" ]
257       }
258     }
259   }
260 } else {
261   group("nacl") {
262   }
265 source_set("nacl_switches") {
266   sources = [
267     "common/nacl_switches.cc",
268     "common/nacl_switches.h",
269   ]
272 source_set("nacl_common") {
273   sources = [
274     "common/nacl_cmd_line.cc",
275     "common/nacl_cmd_line.h",
276     "common/nacl_constants.cc",
277     "common/nacl_constants.h",
278     "common/nacl_host_messages.cc",
279     "common/nacl_host_messages.h",
280     "common/nacl_messages.cc",
281     "common/nacl_messages.h",
282     "common/nacl_nonsfi_util.cc",
283     "common/nacl_nonsfi_util.h",
284     "common/nacl_process_type.h",
285     "common/nacl_renderer_messages.cc",
286     "common/nacl_renderer_messages.h",
287     "common/nacl_sandbox_type_mac.h",
288     "common/nacl_types.cc",
289     "common/nacl_types.h",
290     "common/nacl_types_param_traits.cc",
291     "common/nacl_types_param_traits.h",
292     "common/pnacl_types.cc",
293     "common/pnacl_types.h",
294   ]
296   deps = [
297     ":nacl_switches",
298     "//base",
299     "//content/public/common",
300     "//ipc",
301     "//url",
302   ]
304   if (is_linux) {
305     sources += [
306       "common/nacl_paths.cc",
307       "common/nacl_paths.h",
308     ]
310     defines = [ "__STDC_LIMIT_MACROS=1" ]
311   }