summaryrefslogtreecommitdiff
path: root/chromium/components/cronet/native/BUILD.gn
blob: 6ee1271cf35756388d68c0a4552d6f9b2c284ffa (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
# Copyright 2017 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("//components/cronet/native/include/headers.gni")
import("//components/grpc_support/include/headers.gni")
import("//testing/test.gni")

config("cronet_native_include_config") {
  include_dirs = [
    "//components/cronet/native/generated",
    "//components/cronet/native/include",
    "//components/grpc_support/include",
  ]
}

source_set("cronet_native_headers") {
  deps = [
    "//base",
    "//components/grpc_support:headers",
  ]

  configs += [ ":cronet_native_include_config" ]
  public_configs = [ ":cronet_native_include_config" ]

  public = [
    "include/cronet_c.h",
    "include/cronet_export.h",

    # Generated from cronet.idl.
    "generated/cronet.idl_c.h",
    "generated/cronet.idl_impl_interface.h",
    "generated/cronet.idl_impl_struct.h",
  ]
}

# Cross-platform portion of Cronet native API implementation.
source_set("cronet_native_impl") {
  deps = [
    ":cronet_native_headers",
    "//base",
    "//components/cronet:cronet_common",
    "//components/cronet:cronet_version_header",
    "//components/cronet:metrics_util",
    "//components/grpc_support:grpc_support",
    "//net",
  ]

  configs += [ ":cronet_native_include_config" ]
  public_configs = [ ":cronet_native_include_config" ]
  public_deps = [ ":cronet_native_headers" ]

  sources = [
    "buffer.cc",
    "engine.cc",
    "engine.h",
    "io_buffer_with_cronet_buffer.cc",
    "io_buffer_with_cronet_buffer.h",
    "native_metrics_util.cc",
    "native_metrics_util.h",
    "runnables.cc",
    "runnables.h",
    "upload_data_sink.cc",
    "upload_data_sink.h",
    "url_request.cc",
    "url_request.h",

    # Generated from cronet.idl.
    "generated/cronet.idl_impl_interface.cc",
    "generated/cronet.idl_impl_struct.cc",
  ]
}

# Unit tests for Cronet native API. Depends on cronet_native_impl to test
# implementation details.
source_set("cronet_native_unittests") {
  testonly = true

  deps = [
    ":cronet_native_impl",
    "//base/test:test_support",
    "//components/cronet/native/test:cronet_native_testutil",
    "//net:test_support",
    "//testing/gtest",
  ]

  configs += [ ":cronet_native_include_config" ]

  sources = [
    "engine_unittest.cc",
    "native_metrics_util_test.cc",
    "runnables_unittest.cc",

    # Generated from cronet.idl.
    "generated/cronet.idl_impl_interface_unittest.cc",
    "generated/cronet.idl_impl_struct_unittest.cc",
  ]
}