naiveproxy/services/metrics/public/cpp/BUILD.gn

98 lines
2.0 KiB
Plaintext
Raw Normal View History

2018-12-10 05:59:24 +03:00
# Copyright 2017 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("//mojo/public/tools/bindings/mojom.gni")
component("metrics_cpp") {
sources = [
"delegating_ukm_recorder.cc",
"delegating_ukm_recorder.h",
"metrics_export.h",
"metrics_utils.cc",
"metrics_utils.h",
"mojo_ukm_recorder.cc",
"mojo_ukm_recorder.h",
"ukm_entry_builder.cc",
"ukm_entry_builder.h",
"ukm_entry_builder_base.cc",
"ukm_entry_builder_base.h",
"ukm_recorder.cc",
"ukm_recorder.h",
"ukm_source.cc",
"ukm_source.h",
"ukm_source_id.cc",
"ukm_source_id.h",
]
defines = [ "METRICS_IMPLEMENTATION" ]
public_deps = [
"//base",
"//services/metrics/public/mojom",
"//url",
]
deps = [
"//mojo/public/cpp/bindings",
"//services/service_manager/public/cpp",
"//third_party/metrics_proto",
]
}
source_set("tests") {
testonly = true
sources = [
"metrics_utils_unittest.cc",
"ukm_source_id_unittest.cc",
]
deps = [
":metrics_cpp",
"//base",
"//testing/gtest",
]
}
action("gen_ukm_builders") {
script = "//tools/metrics/ukm/gen_builders.py"
# Re-generate the outputs if the codegen code changes:
inputs = [
"//tools/metrics/ukm/builders_template.py",
"//tools/metrics/ukm/decode_template.py",
"//tools/metrics/ukm/codegen.py",
"//tools/metrics/ukm/gen_builders.py",
]
sources = [
"//tools/metrics/ukm/ukm.xml",
]
outdir = "$target_gen_dir"
outputs = [
outdir + "/ukm_builders.cc",
outdir + "/ukm_builders.h",
outdir + "/ukm_decode.cc",
outdir + "/ukm_decode.h",
]
args = [
"--input",
rebase_path(sources[0], root_build_dir),
"--output",
rebase_path(outdir, root_build_dir),
]
}
static_library("ukm_builders") {
sources = get_target_outputs(":gen_ukm_builders")
deps = [
":gen_ukm_builders",
":metrics_cpp",
"//base",
]
}