summaryrefslogtreecommitdiffstats
path: root/mojo/edk/embedder/BUILD.gn
blob: c4b486d7c733cce75d923fe17c57d4002fea4531 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# 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("../mojo_edk.gni")

mojo_edk_source_set("embedder") {
  # This isn't really a standalone target; it must be linked into the
  # mojo_system_impl component.
  visibility = [ "//mojo/edk/system" ]

  sources = [
    "configuration.h",
    "embedder.cc",
    "embedder.h",
    "embedder_internal.h",
    "entrypoints.cc",
    "system_impl_private_entrypoints.cc",

    # Test-only code:
    # TODO(vtl): It's a little unfortunate that these end up in the same
    # component as non-test-only code. In the static build, this code should
    # hopefully be dead-stripped.
    "test_embedder.cc",
    "test_embedder.h",
  ]

  defines = [
    "MOJO_SYSTEM_IMPL_IMPLEMENTATION",
    "MOJO_SYSTEM_IMPLEMENTATION",
  ]

  configs = [ "//mojo/edk/system:system_config" ]

  public_deps = [
    ":delegates",
    ":platform",
    "//third_party/mojo/src/mojo/public/cpp/system",
    "//third_party/mojo/src/mojo/public/platform/native:system_impl_private_api",
  ]

  deps = [
    "//base",
  ]
}

mojo_edk_source_set("platform") {
  # This isn't really a standalone target; it must be linked into the
  # mojo_system_impl component.
  visibility = [
    ":embedder",
    "//mojo/edk/system",
  ]

  sources = [
    "platform_channel_pair.cc",
    "platform_channel_pair.h",
    "platform_channel_pair_posix.cc",
    "platform_channel_pair_win.cc",
    "platform_channel_utils_posix.cc",
    "platform_channel_utils_posix.h",
    "platform_handle.cc",
    "platform_handle.h",
    "platform_handle_utils.h",
    "platform_handle_utils_posix.cc",
    "platform_handle_utils_win.cc",
    "platform_handle_vector.h",
    "platform_shared_buffer.h",
    "platform_support.h",
    "scoped_platform_handle.h",
    "simple_platform_shared_buffer.cc",
    "simple_platform_shared_buffer.h",
    "simple_platform_shared_buffer_android.cc",
    "simple_platform_shared_buffer_posix.cc",
    "simple_platform_shared_buffer_win.cc",
    "simple_platform_support.cc",
    "simple_platform_support.h",
  ]

  defines = [ "MOJO_SYSTEM_IMPL_IMPLEMENTATION" ]

  configs = [ "//mojo/edk/system:system_config" ]

  public_deps = [
    "//third_party/mojo/src/mojo/public/cpp/system",
  ]

  deps = [
    "//base",
  ]

  if (is_android) {
    deps += [ "//third_party/ashmem" ]
  }
}

mojo_edk_source_set("delegates") {
  # This isn't really a standalone target; it must be linked into the
  # mojo_system_impl component.
  visibility = [
    ":embedder",
    "//mojo/edk/system",
  ]

  sources = [
    "process_delegate.h",
  ]

  defines = [ "MOJO_SYSTEM_IMPL_IMPLEMENTATION" ]

  configs = [ "//mojo/edk/system:system_config" ]

  public_deps = [
    "//third_party/mojo/src/mojo/public/cpp/system",
  ]
}

# TODO(use_chrome_edk): remove "2"
mojo_edk_source_set("embedder_unittests2") {
  testonly = true

  # TODO(use_chrome_edk): remove "2". Also enable this visibility check when we
  # figure out why it's failing just on Android.
  #visibility = [ "//mojo/edk/system:mojo_system_unittests2" ]

  sources = [
    "embedder_unittest.cc",
    "platform_channel_pair_posix_unittest.cc",
    "simple_platform_shared_buffer_unittest.cc",
  ]

  deps = [
    "//base",
    "//base/test:test_support",
    "//mojo/edk/system",
    "//mojo/message_pump",

    # TODO(use_chrome_edk): temporary since the Mojo wrapper primitives are
    # declared in third party only for now.
    "//third_party/mojo/src/mojo/edk/system",
    "//mojo/edk/system:test_utils",
    "//mojo/edk/test:test_support",
    "//testing/gtest",
  ]
}