v8/third_party/google_benchmark/BUILD.gn
Michael Lippautz df4cbb4dff google_benchmark: Manually roll and fix build
Manually roll forward `google_benchmark` and rely on the shipped
export header file. Adjust the build rules to always imply a static
build though as that's how the library is used in v8.

Bug: chromium:1346538
Change-Id: Ia94ad976f533a1c1d8099f1bc931b491d6fb17dd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3782798
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81907}
2022-07-25 07:47:46 +00:00

93 lines
2.5 KiB
Plaintext

# Copyright 2020 The V8 project 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/config/gclient_args.gni")
import("../../gni/v8.gni")
if (v8_enable_google_benchmark) {
config("benchmark_config") {
include_dirs = [ "src/include" ]
defines = [
# We always build google_benchmark statically.
"BENCHMARK_STATIC_DEFINE=1",
]
}
# TODO(crbug.com/1344570): Remove once third_party/google_benchmark no longer
# uses std::wstring_convert.
config("benchmark_suppress_warnings") {
cflags = [ "-Wno-deprecated-declarations" ]
}
source_set("google_benchmark") {
testonly = true
public = [
"src/include/benchmark/benchmark.h",
"src/include/benchmark/export.h",
]
sources = [
"src/src/arraysize.h",
"src/src/benchmark.cc",
"src/src/benchmark_api_internal.cc",
"src/src/benchmark_api_internal.h",
"src/src/benchmark_name.cc",
"src/src/benchmark_register.cc",
"src/src/benchmark_register.h",
"src/src/benchmark_runner.cc",
"src/src/benchmark_runner.h",
"src/src/check.cc",
"src/src/check.h",
"src/src/colorprint.cc",
"src/src/colorprint.h",
"src/src/commandlineflags.cc",
"src/src/commandlineflags.h",
"src/src/complexity.cc",
"src/src/complexity.h",
"src/src/console_reporter.cc",
"src/src/counter.cc",
"src/src/counter.h",
"src/src/csv_reporter.cc",
"src/src/cycleclock.h",
"src/src/internal_macros.h",
"src/src/json_reporter.cc",
"src/src/log.h",
"src/src/mutex.h",
"src/src/perf_counters.cc",
"src/src/perf_counters.h",
"src/src/re.h",
"src/src/reporter.cc",
"src/src/sleep.cc",
"src/src/sleep.h",
"src/src/statistics.cc",
"src/src/statistics.h",
"src/src/string_util.cc",
"src/src/string_util.h",
"src/src/sysinfo.cc",
"src/src/thread_manager.h",
"src/src/thread_timer.h",
"src/src/timers.cc",
"src/src/timers.h",
]
all_dependent_configs = [ ":benchmark_config" ]
configs += [ ":benchmark_suppress_warnings" ]
defines = [
# Tell google_benchmark to always use standard regular expressions.
"HAVE_GNU_POSIX_REGEX=0",
"HAVE_POSIX_REGEX=0",
"HAVE_STD_REGEX=1",
]
}
source_set("benchmark_main") {
testonly = true
sources = [ "src/src/benchmark_main.cc" ]
public_deps = [ ":google_benchmark" ]
}
}