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 # TODO(dpranke) - it's very dangerous to have files being built with one
6 # toolchain having as part of the include_dirs a path to another toolchain's
7 # gen/ directory; it would be easy to end up including files meant for a
8 # different toolchain. We should either change this code to generate the
9 # files in every toolchain, or check in the generated code. Currently
10 # the plan is to do the latter.
12 # All toolchains use the same generated code.
13 gen_dir = "$root_build_dir/gen/mojo/nacl"
16 include_dirs = [ "$root_build_dir/gen" ]
19 # Only allow the generator to be run by one toolchain.
20 if (current_toolchain == default_toolchain) {
21 # Generate the code to plumb the Mojo public API into the NaCl sandbox.
22 action("mojo_nacl_codegen") {
23 script = "generator/generate_nacl_bindings.py"
26 rebase_path(gen_dir, root_build_dir),
30 "generator/interface.py",
31 "generator/interface_dsl.py",
32 "generator/mojo_syscall.cc.tmpl",
33 "generator/libmojo.cc.tmpl",
36 "$gen_dir/mojo_irt.c",
37 "$gen_dir/mojo_irt.h",
38 "$gen_dir/mojo_syscall.cc",
39 "$gen_dir/libmojo.cc",
46 # A library for launching a NaCl sandbox connected to a Mojo embedder.
47 static_library("monacl_sel") {
49 "$gen_dir/mojo_syscall.cc",
50 "mojo_syscall_internal.h",
55 # This target makes sure we have all the pre-processor defines needed to
57 "//native_client/build/config/nacl:nacl_base",
58 "//native_client/src/trusted/desc:nrd_xfer",
59 "//native_client/src/trusted/service_runtime:sel_main_chrome",
60 ":mojo_nacl_codegen($default_toolchain)",
63 [ "//third_party/mojo/src/mojo/public/build/config:mojo_sdk" ]
69 # Thunk mapping the Mojo public API onto NaCl syscalls.
70 static_library("mojo") {
72 "$gen_dir/libmojo.cc",
73 "$gen_dir/mojo_irt.h",
78 "//third_party/mojo/src/mojo/public/build/config:mojo_sdk",
82 ":mojo_nacl_codegen($default_toolchain)",
86 source_set("irt_mojo_sources") {
87 cflags_c = [ "-std=c99" ]
89 "$gen_dir/mojo_irt.c",
90 "$gen_dir/mojo_irt.h",
95 "//third_party/mojo/src/mojo/public/build/config:mojo_sdk",
99 "//native_client/build/config/nacl:nacl_base",
100 "//native_client/src/untrusted/irt:irt_core_lib",
101 "//native_client/src/untrusted/nacl:imc_syscalls",
102 ":mojo_nacl_codegen($default_toolchain)",