Chromium Code Reviews| Index: components/cronet/ios/BUILD.gn |
| diff --git a/components/cronet/ios/BUILD.gn b/components/cronet/ios/BUILD.gn |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6bd86d13e1ee75b1243b5c80e09ef33868785789 |
| --- /dev/null |
| +++ b/components/cronet/ios/BUILD.gn |
| @@ -0,0 +1,155 @@ |
| +# Copyright 2015 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("//build/buildflag_header.gni") |
| +import("//build/util/version.gni") |
| +import("//chrome/version.gni") |
| +import("//testing/test.gni") |
| +import("//url/features.gni") |
| + |
| +assert(!is_component_build, "Cronet requires static library build.") |
| + |
| +declare_args() { |
| + cronet_enable_data_reduction_proxy_support = false |
| +} |
| + |
| +_cronet_version_header_include_dir = "$target_gen_dir/cronet_version_header" |
| +process_version("cronet_version_header") { |
| + template_file = "//components/cronet/version.h.in" |
| + output = "$_cronet_version_header_include_dir/components/cronet/version.h" |
| + extra_args = [ |
| + "-e", |
| + "VERSION_FULL=\"$chrome_version_full\"", |
| + ] |
| +} |
| + |
| +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.
|
| + deps = [ |
| + ":cronet_version_header", |
| + "//net", |
| + "//url", |
| + ] |
| + |
| + sources = [ |
| + "Cronet.h", |
| + "Cronet.mm", |
| + "cronet_bidirectional_stream.cc", |
| + "cronet_bidirectional_stream.h", |
| + "cronet_c_for_grpc.cc", |
| + "cronet_c_for_grpc.h", |
| + "cronet_environment.cc", |
| + "cronet_environment.h", |
| + ] |
| + |
| + include_dirs = [ _cronet_version_header_include_dir ] |
| + |
| + if (!use_platform_icu_alternatives) { |
| + deps += [ "//base:i18n" ] |
| + } |
| +} |
| + |
| +shared_library("libcronet") { |
| + sources = [ |
| + "Cronet.h", |
| + "Cronet.mm", |
| + "cronet_c_for_grpc.cc", |
| + "cronet_c_for_grpc.h", |
| + ] |
| + deps = [ |
| + ":cronet_static", |
| + "//base", |
| + "//net:net", |
| + ] |
| +} |
| + |
| +bundle_data("cronet_test_bundle_data") { |
| + testonly = true |
| + sources = [ |
| + "//net/data/ssl/certificates/quic_test.example.com.crt", |
| + "//net/data/ssl/certificates/quic_test.example.com.key", |
| + "//net/data/ssl/certificates/quic_test.example.com.key.pkcs8", |
| + "//net/data/ssl/certificates/quic_test.example.com.key.sct", |
| + ] |
| + outputs = [ |
| + "{{bundle_resources_dir}}/{{source_file_part}}", |
| + ] |
| +} |
| + |
| +test("cronet_test") { |
| + testonly = true |
| + sources = [ |
| + "test/cronet_bidirectional_stream_test.mm", |
| + "test/cronet_test_runner.mm", |
| + "test/quic_test_server.cc", |
| + "test/quic_test_server.h", |
| + ] |
| + |
| + deps = [ |
| + ":cronet_static", |
| + ":cronet_test_bundle_data", |
| + ":cronet_version_header", |
| + "//base", |
| + "//base:i18n", |
| + "//net", |
| + "//net:simple_quic_tools", |
| + "//net:test_support", |
| + "//third_party/icu", |
| + ] |
| + |
| + include_dirs = [ _cronet_version_header_include_dir ] |
| +} |
| + |
| +test("cronet_unittests") { |
| + sources = [ |
| + "//components/cronet/histogram_manager_unittest.cc", |
| + "//components/cronet/run_all_unittests.cc", |
| + "//components/cronet/url_request_context_config_unittest.cc", |
| + ] |
| + |
| + deps = [ |
| + ":cronet_static", |
| + "//base", |
| + "//base/test:test_support", |
| + "//components/metrics", |
| + "//net", |
| + "//testing/gtest", |
| + ] |
| +} |
| + |
| +_package_dir = "$root_out_dir/cronet" |
| + |
| +action("generate_licenses") { |
| + _license_path = "$_package_dir/LICENSE" |
| + |
| + script = "//components/cronet/tools/cronet_licenses.py" |
| + outputs = [ |
| + _license_path, |
| + ] |
| + args = [ |
| + "license", |
| + 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
|
| + |
| + # "--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.
|
| + ] |
| +} |
| + |
| +copy("cronet_package_copy") { |
| + sources = [ |
| + "//AUTHORS", |
| + "//chrome/VERSION", |
| + ] |
| + outputs = [ |
| + "$_package_dir/{{source_file_part}}", |
| + ] |
| + |
| + deps = [] |
| +} |
| + |
| +group("cronet_package") { |
| + deps = [ |
| + ":cronet_package_copy", |
| + ":cronet_static", |
| + ":generate_licenses", |
| + ] |
| +} |