Chromium Code Reviews| 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") | |
|
brettw
2016/05/03 22:13:03
You can delete this when you change the version pr
mef
2016/05/11 15:57:27
Hrm, process_version is undefined without it.
| |
| 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.") | |
|
brettw
2016/05/03 22:13:03
The link you have going into this file should matc
mef
2016/05/11 15:57:27
Done.
| |
| 12 | |
| 13 declare_args() { | |
| 14 cronet_enable_data_reduction_proxy_support = false | |
| 15 } | |
| 16 | |
| 17 _cronet_version_header_include_dir = "$target_gen_dir/cronet_version_header" | |
| 18 process_version("cronet_version_header") { | |
| 19 template_file = "//components/cronet/version.h.in" | |
| 20 output = "$_cronet_version_header_include_dir/components/cronet/version.h" | |
| 21 extra_args = [ | |
| 22 "-e", | |
| 23 "VERSION_FULL=\"$chrome_version_full\"", | |
|
brettw
2016/05/03 22:13:03
I don't like chrome_version_full and we should onl
mef
2016/05/11 15:57:27
Done.
| |
| 24 ] | |
| 25 } | |
| 26 | |
| 27 # Currently Cronet is used outside of chromium as a prebuilt static library. | |
| 28 # TODO(mef): Convert 'cronet_static' into source_set or merge into libcronet | |
| 29 # cronet dynamic framework is supported. | |
| 30 static_library("cronet_static") { | |
|
brettw
2016/05/03 22:13:03
source_set.
mef
2016/05/11 15:57:27
Done.
| |
| 31 deps = [ | |
| 32 ":cronet_version_header", | |
| 33 "//net", | |
| 34 "//url", | |
| 35 ] | |
| 36 | |
| 37 sources = [ | |
| 38 "../histogram_manager.cc", | |
| 39 "../histogram_manager.h", | |
| 40 "../url_request_context_config.cc", | |
| 41 "../url_request_context_config.h", | |
| 42 "Cronet.h", | |
| 43 "Cronet.mm", | |
| 44 "cronet_bidirectional_stream.cc", | |
| 45 "cronet_bidirectional_stream.h", | |
| 46 "cronet_c_for_grpc.cc", | |
| 47 "cronet_c_for_grpc.h", | |
| 48 "cronet_environment.cc", | |
| 49 "cronet_environment.h", | |
| 50 ] | |
| 51 | |
| 52 include_dirs = [ _cronet_version_header_include_dir ] | |
| 53 | |
| 54 if (!use_platform_icu_alternatives) { | |
| 55 deps += [ "//base:i18n" ] | |
| 56 } | |
| 57 } | |
| 58 | |
| 59 shared_library("libcronet") { | |
| 60 sources = [ | |
| 61 "Cronet.h", | |
| 62 "Cronet.mm", | |
| 63 "cronet_c_for_grpc.cc", | |
| 64 "cronet_c_for_grpc.h", | |
| 65 ] | |
| 66 deps = [ | |
| 67 ":cronet_static", | |
| 68 "//base", | |
| 69 "//net:net", | |
| 70 ] | |
| 71 libs = [ "UIKit.Framework" ] | |
| 72 } | |
| 73 | |
| 74 bundle_data("cronet_test_bundle_data") { | |
| 75 testonly = true | |
| 76 sources = [ | |
| 77 "//net/data/ssl/certificates/quic_test.example.com.crt", | |
| 78 "//net/data/ssl/certificates/quic_test.example.com.key", | |
| 79 "//net/data/ssl/certificates/quic_test.example.com.key.pkcs8", | |
| 80 "//net/data/ssl/certificates/quic_test.example.com.key.sct", | |
| 81 ] | |
| 82 outputs = [ | |
| 83 "{{bundle_resources_dir}}/{{source_file_part}}", | |
| 84 ] | |
| 85 } | |
| 86 | |
| 87 test("cronet_test") { | |
| 88 testonly = true | |
| 89 sources = [ | |
| 90 "test/cronet_bidirectional_stream_test.mm", | |
| 91 "test/cronet_test_runner.mm", | |
| 92 "test/quic_test_server.cc", | |
| 93 "test/quic_test_server.h", | |
| 94 ] | |
| 95 | |
| 96 deps = [ | |
| 97 ":cronet_static", | |
| 98 ":cronet_test_bundle_data", | |
| 99 ":cronet_version_header", | |
| 100 "//base", | |
| 101 "//base:i18n", | |
| 102 "//net", | |
| 103 "//net:simple_quic_tools", | |
| 104 "//net:test_support", | |
| 105 "//third_party/icu", | |
| 106 ] | |
| 107 | |
| 108 include_dirs = [ _cronet_version_header_include_dir ] | |
| 109 } | |
| 110 | |
| 111 test("cronet_unittests") { | |
| 112 sources = [ | |
| 113 "//components/cronet/histogram_manager_unittest.cc", | |
| 114 "//components/cronet/run_all_unittests.cc", | |
| 115 "//components/cronet/url_request_context_config_unittest.cc", | |
| 116 ] | |
| 117 | |
| 118 deps = [ | |
| 119 ":cronet_static", | |
| 120 "//base", | |
| 121 "//base/test:test_support", | |
| 122 "//components/metrics", | |
| 123 "//net", | |
| 124 "//testing/gtest", | |
| 125 ] | |
| 126 } | |
| 127 | |
| 128 _package_dir = "$root_out_dir/cronet" | |
| 129 | |
| 130 action("generate_license") { | |
| 131 _license_path = "$_package_dir/LICENSE" | |
| 132 | |
| 133 script = "//components/cronet/tools/cronet_licenses.py" | |
| 134 outputs = [ | |
| 135 _license_path, | |
| 136 ] | |
| 137 args = [ | |
| 138 "license", | |
| 139 rebase_path(_license_path, root_build_dir), | |
| 140 "--gn_out_dir=" + rebase_path(root_build_dir), | |
|
brettw
2016/05/03 22:13:03
This is a bit suspicious because it will always be
mef
2016/05/11 15:57:27
Done.
| |
| 141 ] | |
| 142 } | |
| 143 | |
| 144 copy("cronet_package_copy") { | |
| 145 sources = [ | |
| 146 "//AUTHORS", | |
| 147 "//chrome/VERSION", | |
| 148 "//components/cronet/ios/Cronet.h", | |
| 149 "//components/cronet/ios/cronet_c_for_grpc.h", | |
| 150 ] | |
| 151 outputs = [ | |
| 152 "$_package_dir/{{source_file_part}}", | |
| 153 ] | |
| 154 | |
| 155 deps = [] | |
| 156 } | |
| 157 | |
| 158 group("cronet_package") { | |
| 159 deps = [ | |
| 160 ":cronet_package_copy", | |
| 161 ":cronet_static", | |
| 162 ":generate_license", | |
| 163 ] | |
| 164 } | |
| OLD | NEW |