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") | |
| 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 _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\"", | |
| 24 ] | |
| 25 } | |
| 26 | |
| 27 static_library("cronet_static") { | |
|
brettw
2016/05/03 17:59:00
This should probably be a source set. If you need
mef
2016/05/03 21:50:20
Done.
| |
| 28 deps = [ | |
| 29 ":cronet_version_header", | |
| 30 "//net", | |
| 31 "//url", | |
| 32 ] | |
| 33 | |
| 34 sources = [ | |
| 35 "Cronet.h", | |
| 36 "Cronet.mm", | |
| 37 "cronet_bidirectional_stream.cc", | |
| 38 "cronet_bidirectional_stream.h", | |
| 39 "cronet_c_for_grpc.cc", | |
| 40 "cronet_c_for_grpc.h", | |
| 41 "cronet_environment.cc", | |
| 42 "cronet_environment.h", | |
| 43 ] | |
| 44 | |
| 45 include_dirs = [ _cronet_version_header_include_dir ] | |
| 46 | |
| 47 if (!use_platform_icu_alternatives) { | |
| 48 deps += [ "//base:i18n" ] | |
| 49 } | |
| 50 } | |
| 51 | |
| 52 shared_library("libcronet") { | |
| 53 sources = [ | |
| 54 "Cronet.h", | |
| 55 "Cronet.mm", | |
| 56 "cronet_c_for_grpc.cc", | |
| 57 "cronet_c_for_grpc.h", | |
| 58 ] | |
| 59 deps = [ | |
| 60 ":cronet_static", | |
| 61 "//base", | |
| 62 "//net:net", | |
| 63 ] | |
| 64 } | |
| 65 | |
| 66 bundle_data("cronet_test_bundle_data") { | |
| 67 testonly = true | |
| 68 sources = [ | |
| 69 "//net/data/ssl/certificates/quic_test.example.com.crt", | |
| 70 "//net/data/ssl/certificates/quic_test.example.com.key", | |
| 71 "//net/data/ssl/certificates/quic_test.example.com.key.pkcs8", | |
| 72 "//net/data/ssl/certificates/quic_test.example.com.key.sct", | |
| 73 ] | |
| 74 outputs = [ | |
| 75 "{{bundle_resources_dir}}/{{source_file_part}}", | |
| 76 ] | |
| 77 } | |
| 78 | |
| 79 test("cronet_test") { | |
| 80 testonly = true | |
| 81 sources = [ | |
| 82 "test/cronet_bidirectional_stream_test.mm", | |
| 83 "test/cronet_test_runner.mm", | |
| 84 "test/quic_test_server.cc", | |
| 85 "test/quic_test_server.h", | |
| 86 ] | |
| 87 | |
| 88 deps = [ | |
| 89 ":cronet_static", | |
| 90 ":cronet_test_bundle_data", | |
| 91 ":cronet_version_header", | |
| 92 "//base", | |
| 93 "//base:i18n", | |
| 94 "//net", | |
| 95 "//net:simple_quic_tools", | |
| 96 "//net:test_support", | |
| 97 "//third_party/icu", | |
| 98 ] | |
| 99 | |
| 100 include_dirs = [ _cronet_version_header_include_dir ] | |
| 101 } | |
| 102 | |
| 103 test("cronet_unittests") { | |
| 104 sources = [ | |
| 105 "//components/cronet/histogram_manager_unittest.cc", | |
| 106 "//components/cronet/run_all_unittests.cc", | |
| 107 "//components/cronet/url_request_context_config_unittest.cc", | |
| 108 ] | |
| 109 | |
| 110 deps = [ | |
| 111 ":cronet_static", | |
| 112 "//base", | |
| 113 "//base/test:test_support", | |
| 114 "//components/metrics", | |
| 115 "//net", | |
| 116 "//testing/gtest", | |
| 117 ] | |
| 118 } | |
| 119 | |
| 120 _package_dir = "$root_out_dir/cronet" | |
| 121 | |
| 122 action("generate_licenses") { | |
| 123 _license_path = "$_package_dir/LICENSE" | |
| 124 | |
| 125 script = "//components/cronet/tools/cronet_licenses.py" | |
| 126 outputs = [ | |
| 127 _license_path, | |
| 128 ] | |
| 129 args = [ | |
| 130 "license", | |
| 131 rebase_path(_license_path, root_build_dir), | |
|
brettw
2016/05/03 17:59:00
Here you're running GN on the same build directory
mef
2016/05/03 21:50:20
Does it mean that the cronet_licenses.py script wo
brettw
2016/05/03 22:13:03
Yes. An alternative would be to check in the licen
mef
2016/05/11 15:57:27
I see. That's a terrible alternative. I've reworke
| |
| 132 | |
| 133 # "--gn_out_dir=" + rebase_path(root_out_dir, root_build_dir), | |
|
brettw
2016/05/03 17:58:59
We should delete this or fix it.
mef
2016/05/03 21:50:20
Done.
| |
| 134 ] | |
| 135 } | |
| 136 | |
| 137 copy("cronet_package_copy") { | |
| 138 sources = [ | |
| 139 "//AUTHORS", | |
| 140 "//chrome/VERSION", | |
| 141 ] | |
| 142 outputs = [ | |
| 143 "$_package_dir/{{source_file_part}}", | |
| 144 ] | |
| 145 | |
| 146 deps = [] | |
| 147 } | |
| 148 | |
| 149 group("cronet_package") { | |
| 150 deps = [ | |
| 151 ":cronet_package_copy", | |
| 152 ":cronet_static", | |
| 153 ":generate_licenses", | |
| 154 ] | |
| 155 } | |
| OLD | NEW |