1# Copyright 2020 The V8 project 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
5import("//build/config/gclient_args.gni")
6import("../../gni/v8.gni")
7
8if (v8_enable_google_benchmark) {
9  config("benchmark_config") {
10    include_dirs = [
11      "src/include",
12      "precompiled_headers",
13    ]
14  }
15
16  source_set("google_benchmark") {
17    testonly = true
18
19    public = [ "src/include/benchmark/benchmark.h" ]
20
21    sources = [
22      "src/src/arraysize.h",
23      "src/src/benchmark.cc",
24      "src/src/benchmark_api_internal.cc",
25      "src/src/benchmark_api_internal.h",
26      "src/src/benchmark_name.cc",
27      "src/src/benchmark_register.cc",
28      "src/src/benchmark_register.h",
29      "src/src/benchmark_runner.cc",
30      "src/src/benchmark_runner.h",
31      "src/src/check.cc",
32      "src/src/check.h",
33      "src/src/colorprint.cc",
34      "src/src/colorprint.h",
35      "src/src/commandlineflags.cc",
36      "src/src/commandlineflags.h",
37      "src/src/complexity.cc",
38      "src/src/complexity.h",
39      "src/src/console_reporter.cc",
40      "src/src/counter.cc",
41      "src/src/counter.h",
42      "src/src/csv_reporter.cc",
43      "src/src/cycleclock.h",
44      "src/src/internal_macros.h",
45      "src/src/json_reporter.cc",
46      "src/src/log.h",
47      "src/src/mutex.h",
48      "src/src/perf_counters.cc",
49      "src/src/perf_counters.h",
50      "src/src/re.h",
51      "src/src/reporter.cc",
52      "src/src/sleep.cc",
53      "src/src/sleep.h",
54      "src/src/statistics.cc",
55      "src/src/statistics.h",
56      "src/src/string_util.cc",
57      "src/src/string_util.h",
58      "src/src/sysinfo.cc",
59      "src/src/thread_manager.h",
60      "src/src/thread_timer.h",
61      "src/src/timers.cc",
62      "src/src/timers.h",
63    ]
64
65    all_dependent_configs = [ ":benchmark_config" ]
66
67    defines = [
68      # Tell google_benchmark to always use standard regular expressions.
69      "HAVE_GNU_POSIX_REGEX=0",
70      "HAVE_POSIX_REGEX=0",
71      "HAVE_STD_REGEX=1",
72    ]
73  }
74
75  source_set("benchmark_main") {
76    testonly = true
77    sources = [ "src/src/benchmark_main.cc" ]
78    public_deps = [ ":google_benchmark" ]
79  }
80}
81