| 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", |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 } | 59 } |
| 60 | 60 |
| 61 # Untrusted code | 61 # Untrusted code |
| 62 if (is_nacl) { | 62 if (is_nacl) { |
| 63 # Thunk mapping the Mojo public API onto NaCl syscalls. | 63 # Thunk mapping the Mojo public API onto NaCl syscalls. |
| 64 static_library("mojo") { | 64 static_library("mojo") { |
| 65 sources = [ | 65 sources = [ |
| 66 "$gen_dir/libmojo.cc", | 66 "$gen_dir/libmojo.cc", |
| 67 ] | 67 ] |
| 68 deps = [ | 68 deps = [ |
| 69 "//native_client/src/untrusted/nacl:imc_syscalls", |
| 69 ":mojo_nacl_codegen($default_toolchain)", | 70 ":mojo_nacl_codegen($default_toolchain)", |
| 70 ] | 71 ] |
| 71 } | 72 } |
| 72 | 73 |
| 73 # Unit test for the Mojo public API. | 74 # Unit test for the Mojo public API. |
| 74 executable("monacl_test") { | 75 executable("monacl_test") { |
| 75 testonly = true | 76 testonly = true |
| 76 sources = [ | 77 sources = [ |
| 77 "//mojo/public/cpp/system/tests/core_unittest.cc", | 78 "//mojo/public/cpp/system/tests/core_unittest.cc", |
| 78 "//mojo/public/cpp/system/tests/macros_unittest.cc", | 79 "//mojo/public/cpp/system/tests/macros_unittest.cc", |
| 79 ] | 80 ] |
| 80 deps = [ | 81 deps = [ |
| 81 "//native_client/src/untrusted/nacl:imc_syscalls", | |
| 82 "//mojo/public/c/system/tests:tests", | 82 "//mojo/public/c/system/tests:tests", |
| 83 "//mojo/public/cpp/system:system", | 83 "//mojo/public/cpp/system:system", |
| 84 "//testing/gtest:gtest", | 84 "//testing/gtest:gtest", |
| 85 "//testing/gtest:gtest_main", | 85 "//testing/gtest:gtest_main", |
| 86 ":mojo", | 86 ":mojo", |
| 87 ] | 87 ] |
| 88 } | 88 } |
| 89 |
| 90 # TODO(ncbray): port this gn file to use mojo_sdk.gni. |
| 91 # TODO(ncbray): fold NaCl build into boilerplate for building Mojo apps. |
| 92 executable("wget") { |
| 93 deps = [ |
| 94 "//mojo/public/cpp/application:standalone", |
| 95 "//mojo/public/cpp/bindings", |
| 96 "//mojo/public/cpp/utility", |
| 97 "//mojo/public/platform/nacl:system", |
| 98 "//mojo/services/network/public/interfaces", |
| 99 ] |
| 100 |
| 101 sources = [ |
| 102 "//examples/wget/wget.cc", |
| 103 ] |
| 104 } |
| 89 } | 105 } |
| 90 | 106 |
| 91 group("mojo_nacl") { | 107 group("mojo_nacl") { |
| 92 deps = [ | 108 deps = [ |
| 93 "//native_client/src/untrusted/irt:irt_core(//native_client/build/toolchain/
nacl:irt_${cpu_arch})", | 109 "//native_client/src/untrusted/irt:irt_core(//native_client/build/toolchain/
nacl:irt_${cpu_arch})", |
| 94 ] | 110 ] |
| 95 } | 111 } |
| 96 | 112 |
| 97 group("mojo_nacl_tests") { | 113 group("mojo_nacl_tests") { |
| 98 testonly = true | 114 testonly = true |
| 99 deps = [ | 115 deps = [ |
| 100 ":monacl_shell", | 116 ":monacl_shell", |
| 101 ":monacl_test(//native_client/build/toolchain/nacl:clang_newlib_${cpu_arch})
", | 117 ":monacl_test(//native_client/build/toolchain/nacl:clang_newlib_${cpu_arch})
", |
| 118 ":wget(//native_client/build/toolchain/nacl:clang_newlib_${cpu_arch})", |
| 102 ] | 119 ] |
| 103 } | 120 } |
| OLD | NEW |