summaryrefslogtreecommitdiffstats
path: root/mojo/shell/runner/host/BUILD.gn
blob: edcce93d503168e849dda4c9355e5faca6782dff (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
# 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.

import("//mojo/public/mojo_application.gni")
import("//mojo/public/tools/bindings/mojom.gni")
import("//testing/test.gni")

group("host") {
  testonly = true

  deps = [
    ":lib",
    ":mojo_runner_host_unittests",
  ]
}

source_set("native_application_support") {
  sources = [
    "native_application_support.cc",
    "native_application_support.h",
  ]

  deps = [
    "//base",
    "//mojo/platform_handle:platform_handle_impl",
    "//mojo/shell",
  ]

  # This target has to include the public thunk headers, which generally
  # shouldn't be included without picking an implementation. We are providing
  # the implementation but the thunk header target cannot declare that we are
  # permitted to include it since it's in the public SDK and we are not.
  # Suppress include checking so we can still check the rest of the targets in
  # this file.
  check_includes = false
}

source_set("child_process_base") {
  sources = [
    "child_process_base.cc",
    "child_process_base.h",
  ]

  deps = [
    "//base",
    "//mojo/edk/system",
    "//mojo/message_pump",
    "//mojo/platform_handle:platform_handle_impl",
    "//mojo/shell",
    "//mojo/shell/public/interfaces",
    "//mojo/shell/runner:init",
    "//mojo/shell/runner/common",
  ]
}

source_set("lib") {
  sources = [
    "child_process.cc",
    "child_process.h",
    "child_process_host.cc",
    "child_process_host.h",
    "in_process_native_runner.cc",
    "in_process_native_runner.h",
    "out_of_process_native_runner.cc",
    "out_of_process_native_runner.h",
  ]

  deps = [
    ":child_process_base",
    ":native_application_support",
    "//base:base_static",
    "//base:i18n",
    "//mojo/message_pump",
    "//mojo/platform_handle:platform_handle_impl",
    "//mojo/shell/public/cpp:sources",
    "//mojo/shell/runner:init",
    "//mojo/shell/runner/common",
  ]

  public_deps = [
    "//base",
    "//mojo/edk/system",
    "//mojo/public/cpp/system",
    "//mojo/shell",
    "//mojo/shell/public/interfaces",
  ]

  if (is_linux && !is_android) {
    sources += [
      "linux_sandbox.cc",
      "linux_sandbox.h",
    ]

    deps += [
      "//sandbox/linux:sandbox",
      "//sandbox/linux:sandbox_services",
      "//sandbox/linux:seccomp_bpf",
      "//sandbox/linux:seccomp_bpf_helpers",
    ]
  }

  if (is_mac) {
    sources += [
      "mach_broker.cc",
      "mach_broker.h",
    ]
  }
}

test("mojo_runner_host_unittests") {
  sources = [
    "child_process_host_unittest.cc",
    "host_unittests.cc",
    "in_process_native_runner_unittest.cc",
  ]

  deps = [
    ":lib",
    "//base",
    "//base/test:test_support",
    "//mojo/edk/system",
    "//mojo/message_pump",
    "//mojo/shell",
    "//mojo/shell/runner:init",
    "//mojo/shell/runner/common",
    "//testing/gtest",
  ]
}