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}
This commit is contained in:
parent
655e76b4f6
commit
df4cbb4dff
2
DEPS
2
DEPS
@ -235,7 +235,7 @@ deps = {
|
|||||||
'dep_type': 'cipd',
|
'dep_type': 'cipd',
|
||||||
},
|
},
|
||||||
'third_party/google_benchmark/src': {
|
'third_party/google_benchmark/src': {
|
||||||
'url': Var('chromium_url') + '/external/github.com/google/benchmark.git' + '@' + 'd4bc509bcd54266e80bef26d5829ea43ead2908e',
|
'url': Var('chromium_url') + '/external/github.com/google/benchmark.git' + '@' + 'ef7f75fb182fc23d03b4a3ecd09cc325ac125dfd',
|
||||||
},
|
},
|
||||||
'third_party/googletest/src':
|
'third_party/googletest/src':
|
||||||
Var('chromium_url') + '/external/github.com/google/googletest.git' + '@' + 'af29db7ec28d6df1c7f0f745186884091e602e07',
|
Var('chromium_url') + '/external/github.com/google/googletest.git' + '@' + 'af29db7ec28d6df1c7f0f745186884091e602e07',
|
||||||
|
18
third_party/google_benchmark/BUILD.gn
vendored
18
third_party/google_benchmark/BUILD.gn
vendored
@ -7,22 +7,26 @@ import("../../gni/v8.gni")
|
|||||||
|
|
||||||
if (v8_enable_google_benchmark) {
|
if (v8_enable_google_benchmark) {
|
||||||
config("benchmark_config") {
|
config("benchmark_config") {
|
||||||
include_dirs = [
|
include_dirs = [ "src/include" ]
|
||||||
"src/include",
|
defines = [
|
||||||
"precompiled_headers",
|
# We always build google_benchmark statically.
|
||||||
|
"BENCHMARK_STATIC_DEFINE=1",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
# TODO(crbug.com/1344570): Remove once third_party/google_benchmark no longer
|
# TODO(crbug.com/1344570): Remove once third_party/google_benchmark no longer
|
||||||
# uses std::wstring_convert.
|
# uses std::wstring_convert.
|
||||||
config("benchmark_suppress_warnings") {
|
config("benchmark_suppress_warnings") {
|
||||||
cflags = ["-Wno-deprecated-declarations"]
|
cflags = [ "-Wno-deprecated-declarations" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
source_set("google_benchmark") {
|
source_set("google_benchmark") {
|
||||||
testonly = true
|
testonly = true
|
||||||
|
|
||||||
public = [ "src/include/benchmark/benchmark.h" ]
|
public = [
|
||||||
|
"src/include/benchmark/benchmark.h",
|
||||||
|
"src/include/benchmark/export.h",
|
||||||
|
]
|
||||||
|
|
||||||
sources = [
|
sources = [
|
||||||
"src/src/arraysize.h",
|
"src/src/arraysize.h",
|
||||||
@ -70,9 +74,7 @@ if (v8_enable_google_benchmark) {
|
|||||||
|
|
||||||
all_dependent_configs = [ ":benchmark_config" ]
|
all_dependent_configs = [ ":benchmark_config" ]
|
||||||
|
|
||||||
configs += [
|
configs += [ ":benchmark_suppress_warnings" ]
|
||||||
":benchmark_suppress_warnings",
|
|
||||||
]
|
|
||||||
|
|
||||||
defines = [
|
defines = [
|
||||||
# Tell google_benchmark to always use standard regular expressions.
|
# Tell google_benchmark to always use standard regular expressions.
|
||||||
|
@ -1,31 +0,0 @@
|
|||||||
// Copyright 2022 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.
|
|
||||||
|
|
||||||
#ifndef THIRD_PARTY_GOOGLE_BENCHMARK_PRECOMPILED_HEADERS_BENCHMARK_EXPORT_H
|
|
||||||
#define THIRD_PARTY_GOOGLE_BENCHMARK_PRECOMPILED_HEADERS_BENCHMARK_EXPORT_H
|
|
||||||
|
|
||||||
// This is a precompiled header as export.h is usually generated by the
|
|
||||||
// libraries build system.
|
|
||||||
|
|
||||||
#ifndef BENCHMARK_EXPORT
|
|
||||||
#define BENCHMARK_EXPORT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef BENCHMARK_NO_EXPORT
|
|
||||||
#define BENCHMARK_NO_EXPORT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef BENCHMARK_DEPRECATED
|
|
||||||
#define BENCHMARK_DEPRECATED __attribute__((__deprecated__))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef BENCHMARK_DEPRECATED_EXPORT
|
|
||||||
#define BENCHMARK_DEPRECATED_EXPORT BENCHMARK_EXPORT BENCHMARK_DEPRECATED
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef BENCHMARK_DEPRECATED_NO_EXPORT
|
|
||||||
#define BENCHMARK_DEPRECATED_NO_EXPORT BENCHMARK_NO_EXPORT BENCHMARK_DEPRECATED
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // THIRD_PARTY_GOOGLE_BENCHMARK_PRECOMPILED_HEADERS_BENCHMARK_EXPORT_H
|
|
Loading…
Reference in New Issue
Block a user