# Copyright (c) 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. import("//build/config/features.gni") import("//build/config/nacl/config.gni") import("//build/config/ui.gni") import("//testing/test.gni") if (enable_nacl) { source_set("nacl") { sources = [ "loader/nacl_ipc_adapter.cc", "loader/nacl_ipc_adapter.h", "loader/nacl_listener.cc", "loader/nacl_listener.h", "loader/nacl_main.cc", "loader/nacl_main_platform_delegate.h", "loader/nacl_main_platform_delegate_linux.cc", "loader/nacl_main_platform_delegate_mac.mm", "loader/nacl_main_platform_delegate_win.cc", "loader/nacl_trusted_listener.cc", "loader/nacl_trusted_listener.h", "loader/nacl_validation_db.h", "loader/nacl_validation_query.cc", "loader/nacl_validation_query.h", ] deps = [ ":nacl_common", ":nacl_switches", "//base", "//base:base_static", "//content/public/common", "//crypto", "//ipc", "//native_client/src/trusted/service_runtime:sel_main_chrome", "//ppapi/c", "//ppapi/proxy:ipc", "//ppapi/shared_impl", "//third_party/mojo/src/mojo/edk/embedder", # TODO(use_chrome_edk): so that EDK in third_party can choose the EDK in # src/mojo if the command line flag is specified. It has to since we can # only have one definition of the Mojo primitives. "//mojo/edk/embedder", ] if (enable_nacl_untrusted) { data_deps = [ "//ppapi/native_client:irt", ] } if (enable_pnacl) { data_deps += [ "//ppapi/native_client/src/untrusted/pnacl_support_extension" ] } } source_set("nacl_browser") { sources = [ "browser/bad_message.cc", "browser/bad_message.h", "browser/nacl_broker_host_win.cc", "browser/nacl_broker_host_win.h", "browser/nacl_broker_service_win.cc", "browser/nacl_broker_service_win.h", "browser/nacl_browser.cc", "browser/nacl_browser.h", "browser/nacl_file_host.cc", "browser/nacl_file_host.h", "browser/nacl_host_message_filter.cc", "browser/nacl_host_message_filter.h", "browser/nacl_process_host.cc", "browser/nacl_process_host.h", "browser/nacl_validation_cache.cc", "browser/nacl_validation_cache.h", "browser/pnacl_host.cc", "browser/pnacl_host.h", "browser/pnacl_translation_cache.cc", "browser/pnacl_translation_cache.h", "common/nacl_debug_exception_handler_win.cc", "common/nacl_debug_exception_handler_win.h", ] deps = [ ":nacl_common", ":nacl_switches", "//base", "//base/third_party/dynamic_annotations", "//content/public/browser", "//content/public/common", "//ipc", "//native_client/src/trusted/service_runtime:sel_main_chrome", "//net", "//ppapi/host", "//ppapi/proxy:ipc", "//ppapi/shared_impl", ] if (is_linux) { sources += [ "zygote/nacl_fork_delegate_linux.cc", "zygote/nacl_fork_delegate_linux.h", ] deps += [ ":nacl_helper", "//sandbox/linux:sandbox_services", "//sandbox/linux:suid_sandbox_client", ] } } source_set("nacl_renderer") { sources = [ "renderer/file_downloader.cc", "renderer/file_downloader.h", "renderer/histogram.cc", "renderer/histogram.h", "renderer/json_manifest.cc", "renderer/json_manifest.h", "renderer/manifest_downloader.cc", "renderer/manifest_downloader.h", "renderer/manifest_service_channel.cc", "renderer/manifest_service_channel.h", "renderer/nacl_helper.cc", "renderer/nacl_helper.h", "renderer/nexe_load_manager.cc", "renderer/nexe_load_manager.h", "renderer/platform_info.cc", "renderer/platform_info.h", "renderer/pnacl_translation_resource_host.cc", "renderer/pnacl_translation_resource_host.h", "renderer/ppb_nacl_private_impl.cc", "renderer/ppb_nacl_private_impl.h", "renderer/progress_event.cc", "renderer/progress_event.h", "renderer/trusted_plugin_channel.cc", "renderer/trusted_plugin_channel.h", ] deps = [ ":nacl_common", ":nacl_switches", "renderer/plugin:nacl_trusted_plugin", "//base", "//content/public/common", "//content/public/renderer", "//ipc", "//net", "//ppapi/c", "//ppapi/proxy:ipc", "//ppapi/shared_impl", "//third_party/WebKit/public:blink", ] } # TODO(GYP): Delete this after we've converted everything to GN. # The _run targets exist only for compatibility w/ GYP. group("nacl_loader_unittests_run") { testonly = true deps = [ ":nacl_loader_unittests", ] } test("nacl_loader_unittests") { sources = [ "loader/nacl_ipc_adapter_unittest.cc", "loader/nacl_validation_query_unittest.cc", "loader/run_all_unittests.cc", ] deps = [ ":nacl", "//base/test:test_support", "//ipc:test_support", "//testing/gtest", ] } if (is_linux) { executable("nacl_helper") { sources = [ "loader/nacl_helper_linux.cc", "loader/nacl_helper_linux.h", ] deps = [ ":nacl", ":nacl_linux", ":nacl_switches", "//base", "//build/config/sanitizers:deps", "//content/public/common", "//crypto", "//ipc", ] cflags = [ "-fPIE" ] ldflags = [ "-pie" ] data_deps = [ "//native_client/src/trusted/service_runtime/linux:bootstrap", ] } source_set("nacl_linux") { sources = [ "loader/sandbox_linux/nacl_bpf_sandbox_linux.cc", "loader/sandbox_linux/nacl_sandbox_linux.cc", ] defines = [ "IN_NACL_HELPER=1" ] deps = [ ":nacl", ":nacl_common", ":nacl_switches", "//base", "//content/public/common", "//crypto", "//ipc", "//sandbox", "//sandbox/linux:sandbox_services_headers", ] if (use_glib) { configs += [ "//build/config/linux:glib" ] } if (use_seccomp_bpf) { defines += [ "USE_SECCOMP_BPF" ] } } } if (is_nacl_nonsfi) { executable("nacl_helper_nonsfi_nexe") { output_name = "nacl_helper_nonsfi" set_sources_assignment_filter([]) sources = [ "common/nacl_messages.cc", "common/nacl_messages.h", "common/nacl_types.cc", "common/nacl_types.h", "common/nacl_types_param_traits.cc", "common/nacl_types_param_traits.h", "loader/nacl_helper_linux.cc", "loader/nacl_helper_linux.h", "loader/nacl_trusted_listener.cc", "loader/nacl_trusted_listener.h", "loader/nonsfi/nonsfi_listener.cc", "loader/nonsfi/nonsfi_listener.h", "loader/nonsfi/nonsfi_main.cc", "loader/nonsfi/nonsfi_main.h", ] deps = [ ":nacl_switches", ":nacl_helper_nonsfi_sandbox", "//base", "//components/tracing", "//content", "//ipc", "//native_client/src/nonsfi/irt:nacl_sys_private", "//native_client/src/nonsfi/loader:elf_loader", "//native_client/src/untrusted/nacl:nacl", "//ppapi/proxy", "//sandbox/linux:sandbox", ] } source_set("nacl_helper_nonsfi_sandbox") { set_sources_assignment_filter([]) sources = [ "loader/nonsfi/nonsfi_sandbox.cc", "loader/nonsfi/nonsfi_sandbox.h", "loader/sandbox_linux/nacl_sandbox_linux.cc", "loader/sandbox_linux/nacl_sandbox_linux.h", ] deps = [ "//base", "//content", "//sandbox/linux:sandbox", ] } copy("nacl_helper_nonsfi_copy") { sources = [ "${root_out_dir}/nacl_helper_nonsfi", ] outputs = [ "${root_build_dir}/{{source_file_part}}", ] deps = [ ":nacl_helper_nonsfi_nexe", ] } } group("helper_nonsfi") { deps = [ ":nacl_helper_nonsfi_copy(//build/toolchain/nacl:newlib_pnacl_nonsfi)", ] } } source_set("nacl_switches") { sources = [ "common/nacl_switches.cc", "common/nacl_switches.h", ] } source_set("nacl_common") { sources = [ "common/nacl_cmd_line.cc", "common/nacl_cmd_line.h", "common/nacl_constants.cc", "common/nacl_constants.h", "common/nacl_host_messages.cc", "common/nacl_host_messages.h", "common/nacl_messages.cc", "common/nacl_messages.h", "common/nacl_nonsfi_util.cc", "common/nacl_nonsfi_util.h", "common/nacl_process_type.h", "common/nacl_renderer_messages.cc", "common/nacl_renderer_messages.h", "common/nacl_sandbox_type.h", "common/nacl_types.cc", "common/nacl_types.h", "common/nacl_types_param_traits.cc", "common/nacl_types_param_traits.h", "common/pnacl_types.cc", "common/pnacl_types.h", ] deps = [ ":nacl_switches", "//base", "//content/public/common", "//ipc", "//url", ] if (is_linux) { sources += [ "common/nacl_paths.cc", "common/nacl_paths.h", ] defines = [ "__STDC_LIMIT_MACROS=1" ] } }