diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-12-10 16:19:40 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-12-10 16:01:50 +0000 |
commit | 51f6c2793adab2d864b3d2b360000ef8db1d3e92 (patch) | |
tree | 835b3b4446b012c75e80177cef9fbe6972cc7dbe /chromium/components/cronet/BUILD.gn | |
parent | 6036726eb981b6c4b42047513b9d3f4ac865daac (diff) | |
download | qtwebengine-chromium-51f6c2793adab2d864b3d2b360000ef8db1d3e92.tar.gz |
BASELINE: Update Chromium to 71.0.3578.93
Change-Id: I6a32086c33670e1b033f8b10e6bf1fd4da1d105d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/components/cronet/BUILD.gn')
-rw-r--r-- | chromium/components/cronet/BUILD.gn | 123 |
1 files changed, 122 insertions, 1 deletions
diff --git a/chromium/components/cronet/BUILD.gn b/chromium/components/cronet/BUILD.gn index e6d5ede628a..62f209ddb11 100644 --- a/chromium/components/cronet/BUILD.gn +++ b/chromium/components/cronet/BUILD.gn @@ -2,10 +2,28 @@ # 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/toolchain/toolchain.gni") +import("//build/util/lastchange.gni") import("//build/util/process_version.gni") import("//build/util/version.gni") +import("//components/cronet/native/include/headers.gni") +import("//components/grpc_support/include/headers.gni") import("//testing/test.gni") +declare_args() { + # If set to true, this will remove histogram manager to reduce binary size. + disable_histogram_support = is_mac || is_win +} + +# Disable histogram support is not allowed on Android. +assert(!disable_histogram_support || !is_android) + +buildflag_header("cronet_buildflags") { + header = "cronet_buildflags.h" + flags = [ "DISABLE_HISTOGRAM_SUPPORT=$disable_histogram_support" ] +} + process_version("cronet_version_header") { template_file = "//components/cronet/version.h.in" sources = [ @@ -40,6 +58,7 @@ source_set("cronet_common") { "url_request_context_config.h", ] deps = [ + ":cronet_buildflags", ":cronet_version_header", "//base", "//components/metrics:metrics", @@ -47,6 +66,17 @@ source_set("cronet_common") { "//net", "//third_party/metrics_proto", ] + + if (disable_histogram_support) { + sources -= [ + "histogram_manager.cc", + "histogram_manager.h", + ] + deps -= [ + "//components/metrics:metrics", + "//third_party/metrics_proto", + ] + } } # Unit tests for Cronet common implementation. @@ -65,6 +95,10 @@ source_set("cronet_common_unittests") { "stale_host_resolver_unittest.cc", "url_request_context_config_unittest.cc", ] + + if (disable_histogram_support) { + sources -= [ "histogram_manager_unittest.cc" ] + } } # For platforms on which the native Cronet library is used, build the library, @@ -105,13 +139,16 @@ if (!is_ios && !is_android) { test("cronet_tests") { deps = [ - ":cronet", + ":cronet_common", "//base", "//base/test:test_support", + "//components/cronet/native:cronet_native_impl", "//components/cronet/native/test:cronet_native_tests", + "//net", ] sources = [ + "cronet_global_state_stubs.cc", "run_all_unittests.cc", ] @@ -137,4 +174,88 @@ if (!is_ios && !is_android) { "run_all_unittests.cc", ] } + + _package_dir = "$root_out_dir/cronet" + + # Generate LICENSE file by recursively joining all dependent licenses. + action("generate_license") { + _license_path = "$_package_dir/LICENSE" + + script = "//tools/licenses.py" + inputs = [ + lastchange_file, + ] + outputs = [ + _license_path, + ] + args = [ + "license_file", + rebase_path(_license_path, root_build_dir), + "--gn-target", + "//components/cronet:cronet", + "--gn-out-dir", + ".", + ] + } + + # Copy boiler-plate files into the package. + copy("cronet_package_copy") { + sources = [ + "//AUTHORS", + "//chrome/VERSION", + ] + + outputs = [ + "$_package_dir/{{source_file_part}}", + ] + } + + # Copy shared library adding the version to the file name. + copy("cronet_package_shlib") { + sources = [ + "$root_out_dir/${shlib_prefix}cronet${shlib_extension}", + ] + + outputs = [ + "$_package_dir/${shlib_prefix}cronet.${chrome_version_full}${shlib_extension}", + ] + + deps = [ + ":cronet", + ] + } + + # Copy headers. + copy("cronet_package_headers") { + sources = cronet_native_public_headers + grpc_public_headers + + outputs = [ + "$_package_dir/include/{{source_file_part}}", + ] + } + + group("cronet_package") { + deps = [ + ":cronet_package_copy", + ":cronet_package_headers", + ":cronet_package_shlib", + ":generate_license", + ] + } + + executable("cronet_native_perf_test") { + testonly = true + sources = [ + "native/perftest/main.cc", + "native/perftest/perf_test.cc", + ] + deps = [ + "//base", + "//components/cronet", + "//components/cronet/native:cronet_native_headers", + "//components/cronet/native/test:cronet_native_tests", + "//components/cronet/native/test:cronet_native_testutil", + "//net:test_support", + ] + } } |