summaryrefslogtreecommitdiff
path: root/chromium/mojo/common/BUILD.gn
blob: 9e74e582d3eec5ecbff2b76770d202fd5a4b64b7 (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
# 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/public/tools/bindings/mojom.gni")
import("//testing/test.gni")

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

mojom("common_custom_types") {
  sources = [
    "file.mojom",
    "file_path.mojom",
    "string16.mojom",
    "text_direction.mojom",
    "time.mojom",
    "unguessable_token.mojom",
    "values.mojom",
    "version.mojom",
  ]
}

component("common_base") {
  output_name = "mojo_common_lib"

  sources = [
    "data_pipe_drainer.cc",
    "data_pipe_drainer.h",
    "data_pipe_utils.cc",
    "data_pipe_utils.h",
  ]

  defines = [ "MOJO_COMMON_IMPLEMENTATION" ]

  public_deps = [
    "//base",
    "//mojo/public/cpp/bindings",
    "//mojo/public/cpp/system",
  ]
}

mojom("test_common_custom_types") {
  sources = [
    "test_common_custom_types.mojom",
    "traits_test_service.mojom",
  ]
  public_deps = [
    ":common_custom_types",
  ]
}

test("mojo_common_unittests") {
  deps = [
    ":common",
    ":common_custom_types",
    ":struct_traits",
    ":test_common_custom_types",
    "//base",
    "//base:message_loop_tests",
    "//base/test:test_support",
    "//mojo/edk/test:run_all_unittests",
    "//mojo/edk/test:test_support",
    "//mojo/public/cpp/bindings",
    "//mojo/public/cpp/test_support:test_utils",
    "//testing/gtest",
    "//url",
  ]

  sources = [
    "common_custom_types_unittest.cc",
    "struct_traits_unittest.cc",
  ]
}

source_set("struct_traits") {
  sources = [
    "common_custom_types_struct_traits.cc",
    "common_custom_types_struct_traits.h",
  ]
  deps = [
    ":common_custom_types_shared_cpp_sources",
    "//base:base",
    "//mojo/public/cpp/system",
  ]
  public_deps = [
    "//base:i18n",
  ]
}