| # Copyright 2015 The Chromium Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| # Trusted code |
| if (!is_nacl) { |
| # A simple shell for running untrusted binaries that talk to the Mojo |
| # embedder. (No services.) |
| executable("monacl_shell") { |
| testonly = true |
| sources = [ |
| "monacl_shell.cc", |
| ] |
| deps = [ |
| "//base:base", |
| "//mojo/edk/system:system", |
| "//nacl_bindings:monacl_sel", |
| ] |
| |
| data_deps = [ "//nacl_bindings:irt_mojo(//native_client/build/toolchain/nacl:irt_${target_cpu})" ] |
| } |
| |
| if (current_cpu == "x86") { |
| # Non-SFI NaCl currently supports x86-32 but not x86-64. Additionally, |
| # PNaCl pexes assume 32-bit pointers. |
| executable("monacl_shell_nonsfi") { |
| testonly = true |
| sources = [ |
| "monacl_shell_nonsfi.cc", |
| ] |
| deps = [ |
| ":irt_mojo_nonsfi", |
| "//mojo/edk/system", |
| "//native_client/src/nonsfi/loader:elf_loader", |
| ] |
| } |
| } |
| } |
| |
| group("monacl_shell_nonsfi_x86") { |
| testonly = true |
| deps = [] |
| if ((target_cpu == "x64" || target_cpu == "x86") && is_linux) { |
| # Even when Mojo is built for x86-64 by default, we want to use x86-32 |
| # for running programs under Non-SFI NaCl. |
| # The toolchain is hardcoded as 32-bit clang here -- although it must |
| # be 32 bit (for nonsfi), it assumes clang. Ideally, the toolchain would |
| # be defined as the 32 bit variant of whatever is being used (be it clang, |
| # gcc, or something else). |
| deps += [ ":monacl_shell_nonsfi(//build/toolchain/linux:clang_x86)" ] |
| } |
| } |
| |
| # Untrusted code |
| if (is_nacl) { |
| # Unit test for the Mojo public API. |
| executable("monacl_test") { |
| testonly = true |
| sources = [ |
| "//mojo/public/cpp/system/tests/core_unittest.cc", |
| "//mojo/public/cpp/system/tests/macros_unittest.cc", |
| ] |
| deps = [ |
| "//mojo/public/c/system/tests:tests", |
| "//mojo/public/cpp/system:system", |
| "//mojo/public/platform/nacl:mojo", |
| "//testing/gtest:gtest", |
| "//testing/gtest:gtest_main", |
| ] |
| } |
| |
| group("mojo_nacl_tests_untrusted") { |
| testonly = true |
| deps = [ |
| ":monacl_test", |
| "//examples/apptest", |
| "//examples/wget", |
| "//services/clipboard", |
| "//services/clipboard:apptests", |
| "//services/files:apptests", |
| "//services/http_server", |
| "//services/http_server:apptests", |
| "//services/view_manager:mojo_view_manager_client_apptests", |
| "//services/view_manager:view_manager_service_apptests", |
| "//services/window_manager:window_manager_apptests", |
| "//shell:apptests", |
| ] |
| } |
| } |
| |
| static_library("irt_mojo_nonsfi") { |
| sources = [ |
| "irt_mojo_nonsfi.cc", |
| "irt_mojo_nonsfi.h", |
| ] |
| |
| deps = [ |
| "//mojo/public/c/system", |
| "//mojo/public/platform/nacl:mojo_irt_header", |
| "//native_client/src/nonsfi/irt:irt_interfaces", |
| ] |
| } |
| |
| group("mojo_nacl") { |
| deps = [ |
| "//services/nacl:nacl_content_handler", |
| "//services/nacl:nacl_content_handler_nonsfi", |
| ] |
| } |
| |
| group("mojo_pnacl_tests") { |
| testonly = true |
| deps = [ |
| ":monacl_test(//native_client/build/toolchain/nacl:newlib_pnacl)", |
| ] |
| } |
| |
| group("mojo_nacl_tests") { |
| testonly = true |
| deps = [ |
| ":mojo_nacl_tests_untrusted(//native_client/build/toolchain/nacl:clang_newlib_${current_cpu})", |
| ":monacl_shell", |
| ":monacl_shell_nonsfi_x86", |
| ":mojo_pnacl_tests", |
| ] |
| } |