| OLD | NEW |
| 1 # All toolchains use the same generated code. | 1 # All toolchains use the same generated code. |
| 2 gen_dir = "$root_build_dir/gen/mojo/nacl" | 2 gen_dir = "$root_build_dir/gen/mojo/nacl" |
| 3 | 3 |
| 4 # Only allow the generator to be run by one toolchain. | 4 # Only allow the generator to be run by one toolchain. |
| 5 if (current_toolchain == default_toolchain) { | 5 if (current_toolchain == default_toolchain) { |
| 6 # Generate the code to plumb the Mojo public API into the NaCl sandbox. | 6 # Generate the code to plumb the Mojo public API into the NaCl sandbox. |
| 7 action("mojo_nacl_codegen") { | 7 action("mojo_nacl_codegen") { |
| 8 script = "generator/generate_nacl_bindings.py" | 8 script = "generator/generate_nacl_bindings.py" |
| 9 args = [ | 9 args = [ |
| 10 "-d", | 10 "-d", |
| 11 rebase_path(gen_dir, root_build_dir), | 11 rebase_path(gen_dir, root_build_dir), |
| 12 ] | 12 ] |
| 13 inputs = [ | 13 inputs = [ |
| 14 script, | 14 script, |
| 15 "generator/interface.py", | 15 "generator/interface.py", |
| 16 "generator/interface_dsl.py", | 16 "generator/interface_dsl.py", |
| 17 "generator/mojo_syscall.cc.tmpl", | 17 "generator/mojo_syscall.cc.tmpl", |
| 18 "generator/libmojo.cc.tmpl", | 18 "generator/libmojo.cc.tmpl", |
| 19 ] | 19 ] |
| 20 outputs = [ | 20 outputs = [ |
| 21 "$gen_dir/mojo_syscall.cc", | 21 "$gen_dir/mojo_syscall.cc", |
| 22 "$gen_dir/libmojo.cc", | 22 "$gen_dir/libmojo.cc", |
| 23 ] | 23 ] |
| 24 public_configs = [ "//third_party/mojo/src/mojo/public/build/config:mojo_sdk
" ] |
| 24 } | 25 } |
| 25 } | 26 } |
| 26 | 27 |
| 27 # Trusted code | 28 # Trusted code |
| 28 if (!is_nacl) { | 29 if (!is_nacl) { |
| 29 # A library for launching a NaCl sandbox connected to a Mojo embedder. | 30 # A library for launching a NaCl sandbox connected to a Mojo embedder. |
| 30 static_library("monacl_sel") { | 31 static_library("monacl_sel") { |
| 31 sources = [ | 32 sources = [ |
| 32 "mojo_syscall_internal.h", | 33 "mojo_syscall_internal.h", |
| 33 "$gen_dir/mojo_syscall.cc", | 34 "$gen_dir/mojo_syscall.cc", |
| 34 "monacl_sel_main.cc", | 35 "monacl_sel_main.cc", |
| 35 ] | 36 ] |
| 37 |
| 36 deps = [ | 38 deps = [ |
| 37 # This target makes sure we have all the pre-processor defines needed to | 39 # This target makes sure we have all the pre-processor defines needed to |
| 38 # use NaCl's headers. | 40 # use NaCl's headers. |
| 39 "//native_client/build/config/nacl:nacl_base", | 41 "//native_client/build/config/nacl:nacl_base", |
| 40 "//native_client/src/trusted/desc:nrd_xfer", | 42 "//native_client/src/trusted/desc:nrd_xfer", |
| 41 "//native_client/src/trusted/service_runtime:sel_main_chrome", | 43 "//native_client/src/trusted/service_runtime:sel_main_chrome", |
| 42 ":mojo_nacl_codegen($default_toolchain)", | 44 ":mojo_nacl_codegen($default_toolchain)", |
| 43 ] | 45 ] |
| 44 } | 46 } |
| 45 | 47 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 58 } | 60 } |
| 59 } | 61 } |
| 60 | 62 |
| 61 # Untrusted code | 63 # Untrusted code |
| 62 if (is_nacl) { | 64 if (is_nacl) { |
| 63 # Thunk mapping the Mojo public API onto NaCl syscalls. | 65 # Thunk mapping the Mojo public API onto NaCl syscalls. |
| 64 static_library("mojo") { | 66 static_library("mojo") { |
| 65 sources = [ | 67 sources = [ |
| 66 "$gen_dir/libmojo.cc", | 68 "$gen_dir/libmojo.cc", |
| 67 ] | 69 ] |
| 68 deps = [ | 70 public_deps = [ |
| 69 ":mojo_nacl_codegen($default_toolchain)", | 71 ":mojo_nacl_codegen($default_toolchain)", |
| 70 ] | 72 ] |
| 71 } | 73 } |
| 72 | 74 |
| 73 # Unit test for the Mojo public API. | 75 # Unit test for the Mojo public API. |
| 74 executable("monacl_test") { | 76 executable("monacl_test") { |
| 75 testonly = true | 77 testonly = true |
| 76 sources = [ | 78 sources = [ |
| 77 "//third_party/mojo/src/mojo/public/cpp/system/tests/core_unittest.cc", | 79 "//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", | 80 "//third_party/mojo/src/mojo/public/cpp/system/tests/macros_unittest.cc", |
| 79 ] | 81 ] |
| 82 include_dirs = [ "//third_party/mojo/src" ] |
| 80 deps = [ | 83 deps = [ |
| 81 "//native_client/src/untrusted/nacl:imc_syscalls", | 84 "//native_client/src/untrusted/nacl:imc_syscalls", |
| 82 "//testing/gtest:gtest", | 85 "//testing/gtest:gtest", |
| 83 "//testing/gtest:gtest_main", | 86 "//testing/gtest:gtest_main", |
| 84 "//third_party/mojo/src/mojo/public/c/system/tests:tests", | 87 "//third_party/mojo/src/mojo/public/c/system/tests:tests", |
| 85 "//third_party/mojo/src/mojo/public/cpp/system:system", | 88 "//third_party/mojo/src/mojo/public/cpp/system:system", |
| 86 ":mojo", | 89 ":mojo", |
| 87 ] | 90 ] |
| 88 } | 91 } |
| 89 } | 92 } |
| 90 | 93 |
| 91 group("mojo_nacl") { | 94 group("mojo_nacl") { |
| 92 deps = [ | 95 deps = [ |
| 93 "//native_client/src/untrusted/irt:irt_core(//native_client/build/toolchain/
nacl:irt_${cpu_arch})", | 96 "//native_client/src/untrusted/irt:irt_core(//native_client/build/toolchain/
nacl:irt_${cpu_arch})", |
| 94 ] | 97 ] |
| 95 } | 98 } |
| 96 | 99 |
| 97 group("mojo_nacl_tests") { | 100 group("mojo_nacl_tests") { |
| 98 testonly = true | 101 testonly = true |
| 99 deps = [ | 102 deps = [ |
| 100 ":monacl_shell", | 103 ":monacl_shell", |
| 101 ":monacl_test(//native_client/build/toolchain/nacl:clang_newlib_${cpu_arch})
", | 104 ":monacl_test(//native_client/build/toolchain/nacl:clang_newlib_${cpu_arch})
", |
| 102 ] | 105 ] |
| 103 } | 106 } |
| OLD | NEW |