summaryrefslogtreecommitdiffstats
path: root/mojo/common/BUILD.gn
blob: 7cbd5bf40c6358a63b8f86a8b935db34d747a6c9 (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
# 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("//testing/test.gni")

group("common") {
  public_deps = [
    ":common_base",
    ":url_type_converters",
  ]
}

# GYP version: mojo/mojo_base.gyp:mojo_common_lib
component("common_base") {
  output_name = "mojo_common_lib"

  sources = [
    "common_type_converters.cc",
    "common_type_converters.h",
    "data_pipe_drainer.cc",
    "data_pipe_drainer.h",
    "data_pipe_file_utils.cc",
    "data_pipe_utils.cc",
    "data_pipe_utils.h",
    "user_agent.cc",
    "user_agent.h",
    "weak_binding_set.h",
    "weak_interface_ptr_set.h",
  ]

  defines = [ "MOJO_COMMON_IMPLEMENTATION" ]

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

  deps = [
    "//base",
    "//base/third_party/dynamic_annotations",
    "//mojo/environment:chromium",
    "//mojo/message_pump",
    "//mojo/public/c/system:for_component",
    "//mojo/public/cpp/bindings",
    "//mojo/public/cpp/environment",
  ]
}

# GYP version: mojo/mojo_base.gyp:mojo_url_type_converters
source_set("url_type_converters") {
  sources = [
    "url_type_converters.cc",
    "url_type_converters.h",
  ]

  include_dirs = [ "//third_party/mojo/src/" ]

  deps = [
    ":common_base",
    "//base",
    "//base/third_party/dynamic_annotations",
    "//mojo/public/cpp/bindings",
    "//url",
  ]
}

# TODO(GYP): Delete this after we've converted everything to GN.
# The _run targets exist only for compatibility w/ GYP.
group("mojo_common_unittests_run") {
  testonly = true
  deps = [
    ":mojo_common_unittests",
  ]
}

# GYP version: mojo/mojo_base.gyp:mojo_common_unittests
test("mojo_common_unittests") {
  deps = [
    ":common",
    "//base",
    "//base:message_loop_tests",
    "//base/test:test_support",
    "//mojo/environment:chromium",
    "//mojo/message_pump",
    "//mojo/public/cpp/bindings",
    "//mojo/public/cpp/test_support:test_utils",
    "//testing/gtest",
    "//third_party/mojo/src/mojo/edk/test:run_all_unittests",
    "//third_party/mojo/src/mojo/edk/test:test_support",
    "//url",
  ]

  sources = [
    # The message_pump tests are so small and some what related to this code
    # that we put them here.
    "../message_pump/handle_watcher_unittest.cc",
    "../message_pump/message_pump_mojo_unittest.cc",
    "common_type_converters_unittest.cc",
  ]
}

test("mojo_common_perftests") {
  deps = [
    ":common",
    "//base",
    "//mojo/environment:chromium",
    "//mojo/message_pump",
    "//mojo/public/cpp/test_support:test_utils",
    "//testing/gtest",
    "//third_party/mojo/src/mojo/edk/test:run_all_perftests",
  ]

  sources = [
    "../message_pump/handle_watcher_perftest.cc",
  ]
}