• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2014 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("//build/config/nacl/config.gni")
6
7source_set("headers") {
8  sources = [
9    "configuration.h",
10    "embedder.h",
11    "embedder_internal.h",
12    "named_platform_channel_pair.h",
13    "platform_channel_pair.h",
14    "platform_handle.h",
15    "platform_handle_utils.h",
16    "process_delegate.h",
17    "scoped_platform_handle.h",
18  ]
19
20  public_deps = [
21    "//base",
22    "//mojo/public/cpp/system",
23  ]
24}
25
26source_set("embedder") {
27  # This isn't really a standalone target; it must be linked into the
28  # mojo_system_impl component.
29  visibility = [
30    "//mojo/edk/system",
31    "//components/nacl:nacl",
32  ]
33
34  sources = [
35    "configuration.h",
36    "embedder.cc",
37    "embedder.h",
38    "embedder_internal.h",
39    "entrypoints.cc",
40    "entrypoints.h",
41    "scoped_ipc_support.cc",
42    "scoped_ipc_support.h",
43
44    # Test-only code:
45    # TODO(vtl): It's a little unfortunate that these end up in the same
46    # component as non-test-only code. In the static build, this code should
47    # hopefully be dead-stripped.
48    "test_embedder.cc",
49    "test_embedder.h",
50  ]
51
52  defines = [ "MOJO_SYSTEM_IMPL_IMPLEMENTATION" ]
53
54  public_deps = [
55    ":delegates",
56    ":headers",
57    ":platform",
58    "//base",
59    "//mojo/public/cpp/system",
60  ]
61
62  if (!is_nacl) {
63    deps = [
64      "//crypto",
65    ]
66  }
67}
68
69source_set("platform") {
70  # This isn't really a standalone target; it must be linked into the
71  # mojo_system_impl component.
72  visibility = [
73    ":embedder",
74    "//mojo/edk/system",
75  ]
76
77  sources = [
78    "named_platform_channel_pair.h",
79    "named_platform_channel_pair_win.cc",
80    "platform_channel_pair.cc",
81    "platform_channel_pair.h",
82    "platform_channel_pair_posix.cc",
83    "platform_channel_pair_win.cc",
84    "platform_channel_utils_posix.cc",
85    "platform_channel_utils_posix.h",
86    "platform_handle.cc",
87    "platform_handle.h",
88    "platform_handle_utils.h",
89    "platform_handle_utils_posix.cc",
90    "platform_handle_utils_win.cc",
91    "platform_handle_vector.h",
92    "platform_shared_buffer.cc",
93    "platform_shared_buffer.h",
94    "scoped_platform_handle.h",
95  ]
96
97  defines = [ "MOJO_SYSTEM_IMPL_IMPLEMENTATION" ]
98
99  public_deps = [
100    "//mojo/public/cpp/system",
101  ]
102
103  deps = [
104    "//base",
105  ]
106
107  if (is_android) {
108    deps += [ "//third_party/ashmem" ]
109  }
110
111  if (is_nacl && !is_nacl_nonsfi) {
112    sources -= [ "platform_channel_utils_posix.cc" ]
113  }
114}
115
116source_set("delegates") {
117  # This isn't really a standalone target; it must be linked into the
118  # mojo_system_impl component.
119  visibility = [
120    ":embedder",
121    "//mojo/edk/system",
122  ]
123
124  sources = [
125    "process_delegate.h",
126  ]
127
128  defines = [ "MOJO_SYSTEM_IMPL_IMPLEMENTATION" ]
129
130  public_deps = [
131    "//mojo/public/cpp/system",
132  ]
133}
134
135source_set("embedder_unittests") {
136  testonly = true
137
138  # TODO: Figure out why this visibility check fails on Android.
139  # visibility = [ "//mojo/edk/system:mojo_system_unittests" ]
140
141  sources = [
142    "embedder_unittest.cc",
143    "platform_channel_pair_posix_unittest.cc",
144    "platform_shared_buffer_unittest.cc",
145  ]
146
147  deps = [
148    "//base",
149    "//base/test:test_support",
150    "//mojo/edk/system",
151    "//mojo/edk/system:test_utils",
152    "//mojo/edk/test:test_support",
153    "//testing/gtest",
154  ]
155}
156