blob: b0acf237b36121c2878133f7f574780df9c22996 [file] [log] [blame]
# Copyright 2014 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/nacl/config.gni")
import("//testing/test.gni")
import("../../../mojo/public/tools/bindings/mojom.gni")
if (is_android) {
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
}
component("system") {
output_name = "mojo_system_impl"
sources = [
"atomic_flag.h",
"awakable.h",
"awakable_list.cc",
"awakable_list.h",
"broker.h",
"broker_host.cc",
"broker_host.h",
"broker_posix.cc",
"broker_win.cc",
"channel.cc",
"channel.h",
"channel_posix.cc",
"channel_win.cc",
"configuration.cc",
"configuration.h",
"core.cc",
"core.h",
"data_pipe_consumer_dispatcher.cc",
"data_pipe_consumer_dispatcher.h",
"data_pipe_control_message.cc",
"data_pipe_control_message.h",
"data_pipe_producer_dispatcher.cc",
"data_pipe_producer_dispatcher.h",
"dispatcher.cc",
"dispatcher.h",
"handle_signals_state.h",
"handle_table.cc",
"handle_table.h",
"mapping_table.cc",
"mapping_table.h",
"message_for_transit.cc",
"message_for_transit.h",
"message_pipe_dispatcher.cc",
"message_pipe_dispatcher.h",
"node_channel.cc",
"node_channel.h",
"node_controller.cc",
"node_controller.h",
"options_validation.h",
"platform_handle_dispatcher.cc",
"platform_handle_dispatcher.h",
"ports_message.cc",
"ports_message.h",
"request_context.cc",
"request_context.h",
"shared_buffer_dispatcher.cc",
"shared_buffer_dispatcher.h",
"wait_set_dispatcher.cc",
"wait_set_dispatcher.h",
"waiter.cc",
"waiter.h",
"watcher.cc",
"watcher.h",
"watcher_set.cc",
"watcher_set.h",
]
defines = [ "MOJO_SYSTEM_IMPL_IMPLEMENTATION" ]
public_deps = [
"//mojo/edk/embedder",
"//mojo/edk/embedder:platform",
"//mojo/edk/system/ports",
"//mojo/public/c/system",
"//mojo/public/cpp/system",
]
deps = [
"//base",
]
if (!is_nacl) {
deps += [ "//crypto" ]
}
if (is_win) {
cflags = [ "/wd4324" ] # Structure was padded due to __declspec(align()),
# which is uninteresting.
}
if (is_mac && !is_ios) {
sources += [
"mach_port_relay.cc",
"mach_port_relay.h",
]
}
if (is_nacl && !is_nacl_nonsfi) {
sources -= [
"broker_host.cc",
"broker_posix.cc",
"channel_posix.cc",
]
}
# Use target_os == "chromeos" instead of is_chromeos because we need to
# build NaCl targets (i.e. IRT) for ChromeOS the same as the rest of ChromeOS.
if (is_android || target_os == "chromeos") {
defines += [ "MOJO_EDK_LEGACY_PROTOCOL" ]
}
allow_circular_includes_from = [ "//mojo/edk/embedder" ]
}
group("tests") {
testonly = true
deps = [
":mojo_system_unittests",
]
if (!is_ios) {
deps += [ ":mojo_message_pipe_perftests" ]
}
}
source_set("test_utils") {
testonly = true
sources = [
"test_utils.cc",
"test_utils.h",
]
public_deps = [
"//mojo/public/c/system",
"//mojo/public/cpp/system",
]
deps = [
"//base",
"//base/test:test_support",
"//mojo/edk/test:test_support",
"//testing/gtest:gtest",
]
}
test("mojo_system_unittests") {
sources = [
"awakable_list_unittest.cc",
"channel_unittest.cc",
"core_test_base.cc",
"core_test_base.h",
"core_unittest.cc",
"message_pipe_unittest.cc",
"options_validation_unittest.cc",
"platform_handle_dispatcher_unittest.cc",
"shared_buffer_dispatcher_unittest.cc",
"shared_buffer_unittest.cc",
"wait_set_dispatcher_unittest.cc",
"waiter_test_utils.cc",
"waiter_test_utils.h",
"waiter_unittest.cc",
"watch_unittest.cc",
]
if (!is_ios) {
sources += [
"data_pipe_unittest.cc",
"multiprocess_message_pipe_unittest.cc",
"platform_wrapper_unittest.cc",
]
}
deps = [
":test_utils",
"//base",
"//base/test:test_support",
"//mojo/edk/embedder:embedder_unittests",
"//mojo/edk/system",
"//mojo/edk/system/ports:tests",
"//mojo/edk/test:run_all_unittests",
"//mojo/edk/test:test_support",
"//testing/gmock",
"//testing/gtest",
]
allow_circular_includes_from = [ "//mojo/edk/embedder:embedder_unittests" ]
}
if (!is_ios) {
test("mojo_message_pipe_perftests") {
sources = [
"message_pipe_perftest.cc",
]
deps = [
":test_utils",
"//base",
"//base/test:test_support",
"//mojo/edk/system",
"//mojo/edk/test:run_all_perftests",
"//mojo/edk/test:test_support",
"//testing/gtest",
]
}
}