1 # All toolchains use the same generated code.
2 gen_dir = "$root_build_dir/gen/mojo/nacl"
4 # Only allow the generator to be run by one toolchain.
5 if (current_toolchain == default_toolchain) {
6 # Generate the code to plumb the Mojo public API into the NaCl sandbox.
7 action("mojo_nacl_codegen") {
8 script = "generator/generate_nacl_bindings.py"
11 rebase_path(gen_dir, root_build_dir),
15 "generator/interface.py",
16 "generator/interface_dsl.py",
17 "generator/mojo_syscall.cc.tmpl",
18 "generator/libmojo.cc.tmpl",
21 "$gen_dir/mojo_syscall.cc",
22 "$gen_dir/libmojo.cc",
29 # A library for launching a NaCl sandbox connected to a Mojo embedder.
30 static_library("monacl_sel") {
32 "mojo_syscall_internal.h",
33 "$gen_dir/mojo_syscall.cc",
37 # This target makes sure we have all the pre-processor defines needed to
39 "//native_client/build/config/nacl:nacl_base",
40 "//native_client/src/trusted/desc:nrd_xfer",
41 "//native_client/src/trusted/service_runtime:sel_main_chrome",
42 ":mojo_nacl_codegen($default_toolchain)",
46 # A simple shell for running untrusted binaries that talk to the Mojo
47 # embedder. (No services.)
48 executable("monacl_shell") {
55 "//third_party/mojo/src/mojo/edk/system:system",
63 # Thunk mapping the Mojo public API onto NaCl syscalls.
64 static_library("mojo") {
66 "$gen_dir/libmojo.cc",
69 ":mojo_nacl_codegen($default_toolchain)",
73 # Unit test for the Mojo public API.
74 executable("monacl_test") {
77 "//third_party/mojo/src/mojo/public/cpp/system/tests/core_unittest.cc",
78 "//third_party/mojo/src/mojo/public/cpp/system/tests/macros_unittest.cc",
81 "//native_client/src/untrusted/nacl:imc_syscalls",
82 "//testing/gtest:gtest",
83 "//testing/gtest:gtest_main",
84 "//third_party/mojo/src/mojo/public/c/system/tests:tests",
85 "//third_party/mojo/src/mojo/public/cpp/system:system",
93 "//native_client/src/untrusted/irt:irt_core(//native_client/build/toolchain/nacl:irt_${cpu_arch})",
97 group("mojo_nacl_tests") {
101 ":monacl_test(//native_client/build/toolchain/nacl:clang_newlib_${cpu_arch})",