| OLD | NEW |
| (Empty) | |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 import("//build/buildflag_header.gni") |
| 6 import("//build/util/version.gni") |
| 7 import("//chrome/version.gni") |
| 8 import("//testing/test.gni") |
| 9 import("//url/features.gni") |
| 10 |
| 11 assert(!is_component_build, "Cronet requires static library build.") |
| 12 |
| 13 declare_args() { |
| 14 cronet_enable_data_reduction_proxy_support = false |
| 15 } |
| 16 |
| 17 process_version("cronet_version_header") { |
| 18 template_file = "//components/cronet/version.h.in" |
| 19 output = "$target_gen_dir/version.h" |
| 20 extra_args = [ |
| 21 "-e", |
| 22 "VERSION_FULL=\"%s.%s.%s.%s\" % (MAJOR,MINOR,BUILD,PATCH)", |
| 23 ] |
| 24 } |
| 25 |
| 26 source_set("cronet_sources") { |
| 27 deps = [ |
| 28 ":cronet_version_header", |
| 29 "//components/metrics:metrics", |
| 30 "//components/metrics/proto:proto", |
| 31 "//net", |
| 32 "//url", |
| 33 ] |
| 34 |
| 35 sources = [ |
| 36 "../histogram_manager.cc", |
| 37 "../histogram_manager.h", |
| 38 "../url_request_context_config.cc", |
| 39 "../url_request_context_config.h", |
| 40 "Cronet.h", |
| 41 "Cronet.mm", |
| 42 "cronet_bidirectional_stream.cc", |
| 43 "cronet_bidirectional_stream.h", |
| 44 "cronet_c_for_grpc.cc", |
| 45 "cronet_c_for_grpc.h", |
| 46 "cronet_environment.cc", |
| 47 "cronet_environment.h", |
| 48 ] |
| 49 |
| 50 if (!use_platform_icu_alternatives) { |
| 51 deps += [ "//base:i18n" ] |
| 52 } |
| 53 } |
| 54 |
| 55 shared_library("cronet_shared") { |
| 56 deps = [ |
| 57 ":cronet_sources", |
| 58 "//base", |
| 59 "//net:net", |
| 60 ] |
| 61 libs = [ "UIKit.Framework" ] |
| 62 } |
| 63 |
| 64 bundle_data("cronet_test_bundle_data") { |
| 65 testonly = true |
| 66 sources = [ |
| 67 "//net/data/ssl/certificates/quic_test.example.com.crt", |
| 68 "//net/data/ssl/certificates/quic_test.example.com.key", |
| 69 "//net/data/ssl/certificates/quic_test.example.com.key.pkcs8", |
| 70 "//net/data/ssl/certificates/quic_test.example.com.key.sct", |
| 71 ] |
| 72 outputs = [ |
| 73 "{{bundle_resources_dir}}/{{source_file_part}}", |
| 74 ] |
| 75 } |
| 76 |
| 77 test("cronet_test") { |
| 78 testonly = true |
| 79 sources = [ |
| 80 "test/cronet_bidirectional_stream_test.mm", |
| 81 "test/cronet_test_runner.mm", |
| 82 "test/quic_test_server.cc", |
| 83 "test/quic_test_server.h", |
| 84 ] |
| 85 |
| 86 deps = [ |
| 87 ":cronet_sources", |
| 88 ":cronet_test_bundle_data", |
| 89 ":cronet_version_header", |
| 90 "//base", |
| 91 "//base:i18n", |
| 92 "//net", |
| 93 "//net:simple_quic_tools", |
| 94 "//net:test_support", |
| 95 "//third_party/icu", |
| 96 ] |
| 97 } |
| 98 |
| 99 test("cronet_unittests") { |
| 100 sources = [ |
| 101 "//components/cronet/histogram_manager_unittest.cc", |
| 102 "//components/cronet/run_all_unittests.cc", |
| 103 "//components/cronet/url_request_context_config_unittest.cc", |
| 104 ] |
| 105 |
| 106 deps = [ |
| 107 ":cronet_sources", |
| 108 "//base", |
| 109 "//base/test:test_support", |
| 110 "//components/metrics", |
| 111 "//net", |
| 112 "//testing/gtest", |
| 113 ] |
| 114 } |
| 115 |
| 116 _package_dir = "$root_out_dir/cronet" |
| 117 |
| 118 action("generate_license") { |
| 119 _license_path = "$_package_dir/LICENSE" |
| 120 |
| 121 script = "//components/cronet/tools/cronet_licenses.py" |
| 122 outputs = [ |
| 123 _license_path, |
| 124 ] |
| 125 args = [ |
| 126 "license", |
| 127 rebase_path(_license_path, root_build_dir), |
| 128 "--gn", |
| 129 ] |
| 130 } |
| 131 |
| 132 copy("cronet_package_copy") { |
| 133 sources = [ |
| 134 "$root_out_dir/libcronet_shared.dylib", |
| 135 "//AUTHORS", |
| 136 "//chrome/VERSION", |
| 137 "//components/cronet/ios/Cronet.h", |
| 138 "//components/cronet/ios/cronet_c_for_grpc.h", |
| 139 ] |
| 140 outputs = [ |
| 141 "$_package_dir/{{source_file_part}}", |
| 142 ] |
| 143 |
| 144 deps = [ |
| 145 ":cronet_shared", |
| 146 ] |
| 147 } |
| 148 |
| 149 group("cronet_package") { |
| 150 deps = [ |
| 151 ":cronet_package_copy", |
| 152 ":generate_license", |
| 153 ] |
| 154 } |
| OLD | NEW |